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

From Tom Lane
Subject Re: [HACKERS] string_to_array with empty input
Date
Msg-id 6569.1238601738@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] string_to_array with empty input  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] string_to_array with empty input  ("David E. Wheeler" <david@kineticode.com>)
Re: [HACKERS] string_to_array with empty input  (justin <justin@emproshunts.com>)
List pgsql-general
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Mar 31, 2009 at 10:44 AM, Greg Stark <stark@enterprisedb.com> wrote:
>> On Tue, Mar 31, 2009 at 3:42 PM, Sam Mason <sam@samason.me.uk> wrote:
>>> string_to_array('',',')::INT[] �=> invalid input syntax for integer: ""
>>
>> Oof. That's a good point.

> +1.  I find this argument much more compelling than anything else
> that's been offered up so far.

Yeah.  It seems to me that if you consider only the case where the array
elements are text, there's a weak preference for considering '' to be a
single empty string; but as soon as you think about any other datatype,
there's a strong preference to consider it a zero-element list.  So I
too have come around to favor the latter interpretation.  Do we have
any remaining holdouts?

            regards, tom lane

pgsql-general by date:

Previous
From: Emanuel Calvo Franco
Date:
Subject: Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…
Next
From: inf200468@ucf.edu.cu
Date:
Subject: consulta demasiado grande