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 7668.1238605778@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] string_to_array with empty input  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: [HACKERS] string_to_array with empty input
List pgsql-general
"David E. Wheeler" <david@kineticode.com> writes:
> Well, I'd just point out that the return value of string_to_array() is
> text[].

True...

> 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.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…
Next
From: Patrick Desjardins
Date:
Subject: Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…