Re: what is good solution for support NULL inside string_to_array function?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: what is good solution for support NULL inside string_to_array function?
Date: 2010-05-04 11:53:00
Message-ID: x2w162867791005040453tc5c7ef5z9fd5711ffe457457@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/5/4 Josh Berkus <josh(at)agliodbs(dot)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
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2010-05-04 13:12:48 Re: max_standby_delay considered harmful
Previous Message Srinivas Naik 2010-05-04 11:46:57 Re: Reg: SQL Query for Postgres 8.4.3