Re: string_to_array with an empty input string

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: string_to_array with an empty input string
Дата
Msg-id B4E292C8-E210-4244-B019-8F6A05AD1F7A@kineticode.com
обсуждение исходный текст
Ответ на Re: string_to_array with an empty input string  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: string_to_array with an empty input string
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: string_to_array with an empty input string