Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id DF8C19FA217 for ; Tue, 27 Mar 2007 12:36:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 62780-01 for ; Tue, 27 Mar 2007 12:35:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 01D279FA1D6 for ; Tue, 27 Mar 2007 12:35:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2RFZi9D021431; Tue, 27 Mar 2007 11:35:44 -0400 (EDT) To: Richard Huxton cc: Sabin Coanda , pgsql-sql@postgresql.org Subject: Re: array_to_string In-reply-to: <46093147.6000209@archonet.com> References: <20090.1175006990@sss.pgh.pa.us> <46093147.6000209@archonet.com> Comments: In-reply-to Richard Huxton message dated "Tue, 27 Mar 2007 15:59:19 +0100" Date: Tue, 27 Mar 2007 11:35:44 -0400 Message-ID: <21430.1175009744@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/318 X-Sequence-Number: 27956 Richard Huxton writes: > Tom Lane wrote: >> "Sabin Coanda" writes: >>> I used the function array_to_string, and I found it ignores NULL values, >>> e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. >> >> Do you have a better idea? > If you're being strict it should presumably return NULL for the whole > string. Or you'd need a "coalesce-to-this" parameter. If the whole array is NULL it would return NULL, but that seems unhelpful for a single element being NULL ... regards, tom lane