"Join" on delimeter aggregate query

From: Michael A Nachbaur <mike(at)nachbaur(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: "Join" on delimeter aggregate query
Date: 2003-06-06 17:03:29
Message-ID: 200306061003.29430.mike@nachbaur.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello everyone,

I've set up PostgreSQL as the authentication / configuration database for my
mail server (Postfix + Courier-IMAP), and though it works beautifully, I need
some help on my aliases query.

You see, define aliases in a database table as rows in a column in the form of
"Source" and "Target". The problem is that one source address can be
delivered to multiple targets (e.g. internal mailing list, or a temporary
forward to another address), but postfix only processes the first record
returned from an SQL query.

Postfix can deliver to multiple targets, if you separate the targets with
comas, like so:

Source Target
joe(at)bob(dot)org address1(at)bob(dot)org,address2(at)bob(dot)org,....

What I would like to do, is something like the following (I know I'd need to
group the query, but you get the idea):

Select DISTINCT(Source), JOIN(Target, ',') FROM Aliases

Is there any way this can be done with Postfix?

--
Michael A Nachbaur <mike(at)nachbaur(dot)com>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-06-06 17:04:04 Re: simulating partial fkeys.. [ATTN Developers please]
Previous Message Chris Gamache 2003-06-06 16:26:35 Elegant SQL solution: