patch: to_string, to_array functions - Mailing list pgsql-hackers

From Pavel Stehule
Subject patch: to_string, to_array functions
Date
Msg-id w2w162867791005051142y9c923802jc1d1a42f126338a9@mail.gmail.com
Whole thread Raw
Responses Re: patch: to_string, to_array functions
List 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

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_migrator to /contrib in a later 9.0 beta
Next
From: Jesper Krogh
Date:
Subject: Re: pg_migrator to /contrib in a later 9.0 beta