Re: [HACKERS] string_to_array with empty input

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <stark(at)enterprisedb(dot)com>, Sam Mason <sam(at)samason(dot)me(dot)uk>, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] string_to_array with empty input
Date: 2009-04-01 17:09:38
Message-ID: 7668.1238605778@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David E. Wheeler 2009-04-01 17:20:28 Re: [HACKERS] string_to_array with empty input
Previous Message Scott Marlowe 2009-04-01 17:06:40 Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2009-04-01 17:14:23 Re: More message encoding woes
Previous Message justin 2009-04-01 17:05:04 Re: [HACKERS] string_to_array with empty input