X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id AD58FEFF77 for ; Fri, 6 Jun 2003 17:03:37 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 46150-06 for ; Fri, 6 Jun 2003 17:03:36 +0000 (GMT) Received: from dbdevel.sunwave.net (h64-141-16-15.sunwave.net [64.141.16.15]) by svr1.postgresql.org (Postfix) with ESMTP id 1C829EFF6F for ; Fri, 6 Jun 2003 17:03:36 +0000 (GMT) Received: from localhost (localhost.localdomain [127.0.0.1]) by dbdevel.sunwave.net (Postfix) with ESMTP id 9D5D0178008 for ; Fri, 6 Jun 2003 13:03:29 -0400 (EDT) From: Michael A Nachbaur To: pgsql-sql@postgresql.org Subject: "Join" on delimeter aggregate query Date: Fri, 6 Jun 2003 10:03:29 -0700 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200306061003.29430.mike@nachbaur.com> X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=USER_AGENT X-Spam-Level: X-Archive-Number: 200306/37 X-Sequence-Number: 13795 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@bob.org address1@bob.org,address2@bob.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