Re: string_to_array with an empty input string

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: string_to_array with an empty input string
Дата
Msg-id 5012.1281537173@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: string_to_array with an empty input string  (Greg Stark <gsstark@mit.edu>)
Ответы Re: string_to_array with an empty input string  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Ideally you really want string_to_array(array_to_string(x, ':'),':')
> to return x. There's no safe return value to pick for the cases where
> x=[''] and x=[] that will make this work.

It's easy to see that string_to_array/array_to_string are *not* usable
as general-purpose serialize/deserialize operations, so sweating over
corner cases like this one seems a bit pointless.  The design center
for 'em seems to be array elements that are numbers, so there's no
issue with empty strings and no great difficulty in picking delimiters
and null representations that can't appear in the data.  I think they're
essentially worthless for arrays of text.
        regards, tom lane


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: assertions and constraint triggers
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: RecordTransactionCommit() and SharedInvalidationMessages