pgsql: Add three-parameter forms of array_to_string and string_to_array, - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Add three-parameter forms of array_to_string and string_to_array,
Date
Msg-id 20100810215100.EB5197541D7@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Add three-parameter forms of array_to_string and string_to_array, to allow
better handling of NULL elements within the arrays.  The third parameter
is a string that should be used to represent a NULL element, or should
be translated into a NULL element, respectively.  If the third parameter
is NULL it behaves the same as the two-parameter form.

There are two incompatible changes in the behavior of the two-parameter form
of string_to_array.  First, it will return an empty (zero-element) array
rather than NULL when the input string is of zero length.  Second, if the
field separator is NULL, the function splits the string into individual
characters, rather than returning NULL as before.  These two changes make
this form fully compatible with the behavior of the new three-parameter form.

Pavel Stehule, reviewed by Brendan Jurd

Modified Files:
--------------
    pgsql/doc/src/sgml:
        func.sgml (r1.525 -> r1.526)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/func.sgml?r1=1.525&r2=1.526)
    pgsql/src/backend/utils/adt:
        array_userfuncs.c (r1.35 -> r1.36)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/array_userfuncs.c?r1=1.35&r2=1.36)
        varlena.c (r1.178 -> r1.179)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/varlena.c?r1=1.178&r2=1.179)
    pgsql/src/include/catalog:
        catversion.h (r1.593 -> r1.594)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.593&r2=1.594)
        pg_proc.h (r1.577 -> r1.578)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.577&r2=1.578)
    pgsql/src/include/utils:
        array.h (r1.77 -> r1.78)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/array.h?r1=1.77&r2=1.78)
        builtins.h (r1.353 -> r1.354)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h?r1=1.353&r2=1.354)
    pgsql/src/test/regress/expected:
        arrays.out (r1.50 -> r1.51)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/arrays.out?r1=1.50&r2=1.51)
    pgsql/src/test/regress/sql:
        arrays.sql (r1.37 -> r1.38)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/arrays.sql?r1=1.37&r2=1.38)

pgsql-committers by date:

Previous
From: petere@postgresql.org (Peter Eisentraut)
Date:
Subject: pgsql: Add some links to tables
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Remove the arbitrary (and undocumented) limit on the number of