patch: to_string, to_array functions

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема patch: to_string, to_array functions
Дата
Msg-id w2w162867791005051142y9c923802jc1d1a42f126338a9@mail.gmail.com
обсуждение исходный текст
Ответы Re: patch: to_string, to_array functions  (Brendan Jurd <direvus@gmail.com>)
Список pgsql-hackers
Hello

attached patch contains to_string and to_array functions. These
functions are equivalent of array_to_string and string_to_array
function with maybe more correct NULL handling.

postgres=# select to_array('1,2,3,4,,6',',');
     to_array
------------------
 {1,2,3,4,NULL,6}
(1 row)

postgres=# select to_array('1,2,3,4,,6',',','***');
    to_array
----------------
 {1,2,3,4,"",6}
(1 row)

postgres=# select to_string(array[1,2,3,4,NULL,6],',');
 to_string
------------
 1,2,3,4,,6
(1 row)

postgres=# select to_string(array[1,2,3,4,NULL,6],',','***');
   to_string
---------------
 1,2,3,4,***,6
(1 row)

Regards
Pavel Stehule

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_migrator to /contrib in a later 9.0 beta
Следующее
От: Jesper Krogh
Дата:
Сообщение: Re: pg_migrator to /contrib in a later 9.0 beta