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

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add three-parameter forms of array_to_string and string_to_array,
Date: 2010-08-10 21:51:00
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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:
func.sgml (r1.525 -> r1.526)
array_userfuncs.c (r1.35 -> r1.36)
varlena.c (r1.178 -> r1.179)
catversion.h (r1.593 -> r1.594)
pg_proc.h (r1.577 -> r1.578)
array.h (r1.77 -> r1.78)
builtins.h (r1.353 -> r1.354)
arrays.out (r1.50 -> r1.51)
arrays.sql (r1.37 -> r1.38)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-08-10 23:02:00 pgsql: Remove the arbitrary (and undocumented) limit on the number of
Previous Message Peter Eisentraut 2010-08-10 20:42:02 pgsql: Add some links to tables