Re: [HACKERS] string_to_array with empty input

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: [HACKERS] string_to_array with empty input
Дата
Msg-id FAA0F11E-B5EB-4B25-BF2B-3C12C48FF883@kineticode.com
обсуждение исходный текст
Ответ на Re: [HACKERS] string_to_array with empty input  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Apr 1, 2009, at 10:09 AM, Tom Lane wrote:

>> Thus, this is not a problem with string_to_array(), but a
>> casting problem from text[] to int[].
>
> Nonsense.  The question is whether string_to_array is meant to be
> useful
> for lists of anything except text.  I agree you could argue that it
> isn't.  But even in the domain of text it's not all that cut-and-dried
> whether string_to_array should return array[] or array[''] for empty
> input.  So ISTM we're giving up less than we gain by choosing the
> former.

Yeah. I'm okay with either, as long as it's consistent. I have a mild
preference for '{""}', but I can live with ARRAY[] instead. As long as
it's not NULL that gets returned.

Best,

David

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

Предыдущее
От: "Scott Mead"
Дата:
Сообщение: Re: [GENERAL] Re: [GENERAL] ERROR: XX001: could not read block 2354 of relation…
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: [HACKERS] string_to_array with empty input