Re: array_to_string

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Sabin Coanda <sabin(dot)coanda(at)deuromedia(dot)ro>, pgsql-sql(at)postgresql(dot)org
Subject: Re: array_to_string
Date: 2007-03-27 15:35:44
Message-ID: 21430.1175009744@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Richard Huxton <dev(at)archonet(dot)com> writes:
> Tom Lane wrote:
>> "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2007-03-27 15:45:01 Re: array_to_string
Previous Message Richard Huxton 2007-03-27 14:59:19 Re: array_to_string