PostgreSQL SELECT question

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Aug 30 18:28:02 UTC 2007


Ian Petersen wrote:
> Sorry, I didn't really parse all the SQL you posted in your original
> email.  I assumed that you would create a view that performs the
> necessary join to recreate the old table structure from the new
> structure.  If you did that, then the existing query you're using to
> get the file from the email address should still work.
> 
> I suppose you want something like this:
> 
> CREATE VIEW address_to_filesystem AS
> SELECT u.usr_email || '@' || d.dom_name as address,
>        d.dom_name || '/' || u.usr_email || '/inbox' as file
> FROM users u JOIN domains d ON u.usr_dom_id = d.dom_id;
> 
> The above should create a view with fields address and file where the
> address is 'user at domain' and the file is 'user/domain/inbox'.  Then
> you can tell Postfix to
> 
> SELECT file FROM address_to_filesystem WHERE address = 'user at domain';
> 
> HTH,
> Ian
> 

Ian, you rock!

That works like a charm. I am duly humbled. :)

Madi
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list