Re: [HACKERS] string_to_array with empty input

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:20:28
Message-ID: FAA0F11E-B5EB-4B25-BF2B-3C12C48FF883@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David E. Wheeler 2009-04-01 17:23:18 Re: [HACKERS] string_to_array with empty input
Previous Message Tom Lane 2009-04-01 17:09:38 Re: [HACKERS] string_to_array with empty input

Browse pgsql-hackers by date

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