Re: what is good solution for support NULL inside string_to_array function? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: what is good solution for support NULL inside string_to_array function?
Date
Msg-id x2w162867791005040453tc5c7ef5z9fd5711ffe457457@mail.gmail.com
Whole thread Raw
In response to Re: what is good solution for support NULL inside string_to_array function?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
2010/5/4 Josh Berkus <josh@agliodbs.com>:
>
>> quietly removing NULL is maybe good for compatibility but is wrong for
>> functionality.
>
> I agree.  I wasn't aware of this little misfeature.
>
> Default display for NULL should be a zero-length string.
>

I disagree - NULL is NULL, not empty string (Oracle is different)

if array_to_string is equivalent to

x[1] || sep || x[2] || sep || x[3] || sep ....

then correct result is NULL

and then string_to_array and array_to_string are correct, because
string_to_array cannot contain any NULL symbol.

Regards
Pavel Stehule



> --
>                                  -- Josh Berkus
>                                     PostgreSQL Experts Inc.
>                                     http://www.pgexperts.com
>


pgsql-hackers by date:

Previous
From: Srinivas Naik
Date:
Subject: Re: Reg: SQL Query for Postgres 8.4.3
Next
From: Stephen Frost
Date:
Subject: Re: max_standby_delay considered harmful