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

From David E. Wheeler
Subject Re: [HACKERS] string_to_array with empty input
Date
Msg-id FAA0F11E-B5EB-4B25-BF2B-3C12C48FF883@kineticode.com
Whole thread Raw
In response to Re: [HACKERS] string_to_array with empty input  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Apr 1, 2009, at 10:09 AM, Tom Lane wrote:

>> Thus, this is not a problem with string_to_array(), but a
>> casting problem from text[] to int[].
>
> Nonsense.  The question is whether string_to_array is meant to be
> useful
> for lists of anything except text.  I agree you could argue that it
> isn't.  But even in the domain of text it's not all that cut-and-dried
> whether string_to_array should return array[] or array[''] for empty
> input.  So ISTM we're giving up less than we gain by choosing the
> former.

Yeah. I'm okay with either, as long as it's consistent. I have a mild
preference for '{""}', but I can live with ARRAY[] instead. As long as
it's not NULL that gets returned.

Best,

David

pgsql-general by date:

Previous
From: "Scott Mead"
Date:
Subject: Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…
Next
From: "David E. Wheeler"
Date:
Subject: Re: [HACKERS] string_to_array with empty input