Re: string_to_array with empty input

Поиск
Список
Период
Сортировка
От Justin
Тема Re: string_to_array with empty input
Дата
Msg-id 49D195FC.6070403@emproshunts.com
обсуждение исходный текст
Ответ на Re: string_to_array with empty input  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> I agree this seems less than consistent though, especially seeing
> that you *don't* get a null for a zero-length separator, which if
> anything is a more poorly defined case.
>
> I doubt it'd be a good idea to back-patch a change for this,
> but I could see altering the definition for 8.4.
>
> Does anyone want to argue for keeping it the same?  Or perhaps
> argue that a zero-element array is a more sensible result than
> a one-element array with one empty string?  (It doesn't seem
> like it to me, but maybe somebody thinks so.)
>
>             regards, tom lane
>

I  like the array to contain single zero length string.   A  string was
passed in  although empty,  its still a string not a NULL.

Returning an empty array implies nothing was passed to the function
although something was. That seems kinda odd to me also, give  back what
was sent in broken into an array.

I use this and split_part allot in our database to break apart  part numbers


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

Предыдущее
От: Stuart Bishop
Дата:
Сообщение: Re: pgstattuple triggered checkpoint failure and database outage?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgstattuple triggered checkpoint failure and database outage?