Tom Lane wrote:
David Fetter <da...@fetter.org> writes:
The next one is just plain unexpected.

array_to_string ignores null elements.  What do you think it should do
with them?

                        regards, tom lane

This seems somewhat related to the long-running discussion from back in February-April regarding string_to_array with empty input which faded away somewhere around here: http://archives.postgresql.org/pgsql-hackers/2009-04/msg00363.php. At the time the decision was to defer any decision to after 8.4.

Perhaps there is a solution which can address both cases - ideally one which would, to the extent practical, allow string_to_array to be the inverse of array_to_string. This could be particularly useful when dealing with clients that don't know how to directly deal with PostgreSQL arrays but which can generally easily deal with strings.

Although it might cause a fair amount of backward-compatibility trouble, the string representation could either use NULL to represent a null element as is allowed in other contexts or require that empty-string elements be represented as "" to differentiate ,"", (empty-string element) from ,, (null element).

Cheers,
Steve

Reply via email to