Re: string_to_array with an empty input string

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: string_to_array with an empty input string
Дата
Msg-id AANLkTikfjHwFfTMd+cr4+H4ZHxa4SCELV5qS-148bBpu@mail.gmail.com
обсуждение исходный текст
Ответ на string_to_array with an empty input string  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: string_to_array with an empty input string  ("David E. Wheeler" <david@kineticode.com>)
Список pgsql-hackers
On 10 August 2010 19:41, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Looking through Pavel's string_to_array patch, I notice that the new
> version of string_to_array returns an empty (zero-element) array when
> the input string is of zero length, whereas the traditional version
> returned NULL instead.  The patch fails to emulate the old behavior
> exactly, but rather than fix it, I wonder if we shouldn't make the two
> versions behave the same.  (If we don't have them doing the same thing,
> we're going to have to document the difference...)  The NULL result
> seems a bit peculiar to me, and the empty-array result saner.  Given
> the general inconsistency surrounding empty arrays elsewhere, I think
> this wouldn't be a very problematic change for most users.
>
> Thoughts?
>

I, personally, would expect an empty array output given an empty
input, and a null output for a null input.
--
Thom Brown
Registered Linux user: #516935


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Session timeout on commitfest.postgresql.org
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: string_to_array with an empty input string