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

2010-05-07 Thread Steve Crawford
Tom Lane wrote: Josh Berkus writes: 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. That's just as broken as Pave

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

2010-05-04 Thread Pavel Stehule
2010/5/4 Merlin Moncure : > On Tue, May 4, 2010 at 10:05 AM, Pavel Stehule > wrote: >> and then string_to_array and array_to_string are orthogonal with NULL. > > I like the behavior, but should it share the name with the 2 argument > version given the incompatibility? Maybe make a new function >

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

2010-05-04 Thread Merlin Moncure
On Tue, May 4, 2010 at 10:05 AM, Pavel Stehule wrote: > and then string_to_array and array_to_string are orthogonal with NULL. I like the behavior, but should it share the name with the 2 argument version given the incompatibility? Maybe make a new function to_string(anyarray, sep, nullsym='') an

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

2010-05-04 Thread Pavel Stehule
2010/5/4 Pavel Stehule : > 2010/5/4 Tom Lane : >> Josh Berkus writes: 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. >> >> Tha

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

2010-05-04 Thread Pavel Stehule
2010/5/4 Josh Berkus : > >> 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 differe

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

2010-05-03 Thread Pavel Stehule
2010/5/4 Tom Lane : > Josh Berkus writes: >>> 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. > > That's just as broken as Pavel's sugges

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

2010-05-03 Thread Andrew Dunstan
Tom Lane wrote: Default display for NULL should be a zero-length string. That's just as broken as Pavel's suggestion. Unless you have something that is guaranteed distingishable from the output of any non-null value, you really can't make a significant improvement here.

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

2010-05-03 Thread Tom Lane
Josh Berkus writes: >> 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. That's just as broken as Pavel's suggestion. Unless you have somethi

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

2010-05-03 Thread Josh Berkus
> 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. -- -- Josh Berkus Postg

[HACKERS] what is good solution for support NULL inside string_to_array function?

2010-05-03 Thread Pavel Stehule
Hello I understand why we don't support expression 'null'::sometype. But it does problems with array deserialisation. postgres=# select array_to_string(ARRAY[10,20,30,NULL,30], '|'); array_to_string - 10|20|30|30 (1 row) quietly removing NULL is maybe good for compatibility but