Re: array_to_string bug?

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_to_string bug?
Date: 2009-11-12 18:28:17
Message-ID: 4AFC53C1.5050009@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> David Fetter <david(at)fetter(dot)org> writes:
>
>> The next one is just plain unexpected.
>>
>
> array_to_string ignores null elements. What do you think it should do
> with them?
>
> regards, tom lane
>
>
This seems somewhat related to the long-running discussion from back in
February-April regarding string_to_array with empty input which faded
away somewhere around here:
http://archives.postgresql.org/pgsql-hackers/2009-04/msg00363.php. At
the time the decision was to defer any decision to after 8.4.

Perhaps there is a solution which can address both cases - ideally one
which would, to the extent practical, allow string_to_array to be the
inverse of array_to_string. This could be particularly useful when
dealing with clients that don't know how to directly deal with
PostgreSQL arrays but which can generally easily deal with strings.

Although it might cause a fair amount of backward-compatibility trouble,
the string representation could either use NULL to represent a null
element as is allowed in other contexts or require that empty-string
elements be represented as "" to differentiate ,"", (empty-string
element) from ,, (null element).

Cheers,
Steve

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-11-12 18:31:07 Re: next CommitFest
Previous Message Josh Berkus 2009-11-12 18:27:00 Re: Patch committers