Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 7F1111B7B373 for ; Sun, 3 Jun 2012 06:57:01 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sb7YR-00046m-74 for pgsql-bugs@postgresql.org; Sun, 03 Jun 2012 09:57:00 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sb7YE-0004Jc-4j for pgsql-bugs@postgresql.org; Sun, 03 Jun 2012 09:56:46 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1Sb7YD-0002DF-IT for pgsql-bugs@postgresql.org; Sun, 03 Jun 2012 09:56:45 +0000 Date: Sun, 03 Jun 2012 09:56:45 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6674: functon aggregat To: pgsql-bugs@postgresql.org From: shinsetsusan@yahoo.fr X-Pg-Spam-Score: -1.0 (-) X-Archive-Number: 201206/18 X-Sequence-Number: 33245 The following bug has been logged on the website: Bug reference: 6674 Logged by: susan Email address: shinsetsusan@yahoo.fr PostgreSQL version: 9.1.3 Operating system: windows vista 64b Description: = Hi, when i use string_agg without DISTINCT, this function return somes empty aggregate row result But not with DISTINCT. To reproduce it, use Geoname database from geonames.org with this request SELECT iso, string_agg(DISTINCT fcode, ',') as n FROM "GeoNames" WHERE fcode LIKE 'ADM%' GROUP BY iso ORDER BY iso ASC; =