Re: string_to_array with an empty input string

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: string_to_array with an empty input string
Date: 2010-08-11 17:49:12
Message-ID: B4E292C8-E210-4244-B019-8F6A05AD1F7A@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Aug 11, 2010, at 9:36 AM, Tom Lane wrote:

>>
>> I believe those are all "", rather than '"' + undef + '"'.
>
> If you believe my previous opinion that the design center for these
> functions is arrays of numbers, then a zero-entry text[] array is what
> you want, because you can successfully cast it to a zero-entry array of
> integers or floats or whatever. Returning a single empty string will
> make those cases fail. So at the moment I'm on the side of the fence
> that says zero-entry array is the best answer.

Seems to be precedent for that:

% perl -E 'say scalar @{[ split ",", ""]}'
0

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2010-08-11 17:49:52 Re: string_to_array with an empty input string
Previous Message Peter Geoghegan 2010-08-11 17:32:53 Re: string_to_array with an empty input string