Re: [HACKERS] string_to_array with empty input - Mailing list pgsql-general

From Robert Haas
Subject Re: [HACKERS] string_to_array with empty input
Date
Msg-id 603c8f070904021301paa7d20are16b5e5719644b61@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] string_to_array with empty input  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] string_to_array with empty input  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
On Thu, Apr 2, 2009 at 2:50 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Thu, Apr 2, 2009 at 2:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> If there's a camp that actually *wants* a NULL result for this case,
>>> I missed the reasoning.
>
>> So that we don't break existing apps because of an issue that is
>> trivial to work around.
>
> We would only be breaking them if a NULL result were actually the
> correct behavior for the application's requirements, which seems
> a bit unlikely.

But that's completely untrue.  If the most useful behavior is either
ARRAY[''] or ARRAY[], then there are presumably lots and lots of
people out there who have apps that do COALESCE(string_to_array(...),
something).  Whichever way you change string_to_array() will break all
of the people doing this who wanted the opposite behavior for no good
reason.

...Robert

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: reducing IO and memory usage: sending the content of a table to multiple files
Next
From: Scott Marlowe
Date:
Subject: Re: Postgresql installation with ssh connection.