Re: patch: to_string, to_array functions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>
Subject: Re: patch: to_string, to_array functions
Date: 2010-07-23 19:32:11
Message-ID: AANLkTimCBajPRWKpD1KzGvx+N6ybtaXPbOe5-Lwp=kKk@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Dimitry

>>
>> I still don't see a compelling reason not to extend existing functions
>> with a third argument. Or are we talking about deprecating them in the
>> future (like remove their mention in the docs) and have the new names to
>> replace them, with the new behavior as the default and the extended call
>> convention as the old behavior?
>
> just incomplete default behave :(. We can enhance old functions, but
> we cannot to change default behave - it is mean, so we will to ignore
> a NULLs in arrays forever - but it isn't true a three years. It is a
> feature now. Please look to archive. There was a discus about it.
>

The reason, why I am strong in change of default behave is only one -
I know only one use-case for curent behave - when array_to_string
ignore a NULL, - when you would to remove NULLs from array, you can do
string_to_array(array_to_string(x,'###'), '###') - I don't know other
use-case. When I have a NULL in array, then it have a some sense
there. And I can remove NULLs from array via more secure and faster
way

SELECT array(SELECT v FROM unnest(x) g(x) WHERE v IS NOT NULL)

using string_to_array and array_to_string is slower and for some
domains can be wrong (for text).

Regards

Pavel

p.s. I expect so anybody who has NULLs in an array not only for a joy.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-07-23 19:32:52 Re: Rewrite, normal execution vs. EXPLAIN ANALYZE
Previous Message David Fetter 2010-07-23 19:31:59 Re: Rewrite, normal execution vs. EXPLAIN ANALYZE