Search Postgresql Archives

Re: select array_remove(ARRAY[NULL,NULL,NULL],NULL); returns {} instead of {NULL,NULL,NULL}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> On Mon, Aug 8, 2016 at 5:51 PM, Alban Hertroys <haramrae@xxxxxxxxx> wrote:
>> How does it now which unknown value to remove from that array of unknown
>> values? Shouldn't the result be:
>> {NULL,NULL,NULL}?

> â??Is this a philosophical or technical question?

> For the former I don't see why one would choose to define this function in
> any other way.  If you accept that the searching value can be NULL then it
> follows that you must compare two NULLs as equal.

Strictly speaking, array_remove (and I think array_replace as well)
implements "IS NOT DISTINCT FROM" semantics rather than "=" semantics.
I dunno that we want to make the documentation use that wording though,
it'd probably confuse more people than it helped.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux