Re: [HACKERS] string_to_array with empty input

Поиск
Список
Период
Сортировка
От justin
Тема Re: [HACKERS] string_to_array with empty input
Дата
Msg-id 49D24976.5040300@emproshunts.com
обсуждение исходный текст
Ответ на Re: [HACKERS] string_to_array with empty input  (Sam Mason <sam@samason.me.uk>)
Ответы Re: string_to_array with empty input  (Greg Stark <stark@enterprisedb.com>)
Список pgsql-general
Sam Mason wrote:
>
>   string_to_array('',',')::INT[]  => invalid input syntax for integer: ""
>
> Which you don't get at the moment; although you do currently get it in
> other common cases such as:
>
>   string_to_array('1,',',')::INT[]
>
> If you want backwards compatible behaviour you could always bung a
> NULLIF in there:
>
>   string_to_array(NULLIF('',''),',')::INT[]  => NULL
>
>
>

But consider  this fails also

select string_to_array('1, , 3', ',' )::int[] => ERROR:  invalid input
syntax for integer: " "

yet this works

select string_to_array('1, 2, 3',',')::int[]

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

Предыдущее
От: Harald Fuchs
Дата:
Сообщение: Re: [GENEAL] dynamically changing table
Следующее
От: Greg Stark
Дата:
Сообщение: Re: string_to_array with empty input