Re: pgsql 8.4 "not" + "is contained by" operators return wrong result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: László Lajos Jánszky <laszlo(dot)janszky(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pgsql 8.4 "not" + "is contained by" operators return wrong result
Date: 2013-07-25 17:15:24
Message-ID: 21403.1374772524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?ISO-8859-1?Q?L=E1szl=F3_Lajos_J=E1nszky?= <laszlo(dot)janszky(at)gmail(dot)com> writes:
> The following query returns nothing, but it should return 1.
> *SELECT 1 FROM NOT(ARRAY[1] <@ NULL**); *

I assume you meant SELECT 1 WHERE NOT(ARRAY[1] <@ NULL) ?
Because what you wrote doesn't parse.

This is not a bug. "ARRAY[1] <@ NULL" yields NULL. NOT (NULL) is still
NULL. WHERE treats a NULL result as FALSE.

It might help you to consider that NULL means "unknown". It does not
mean "empty array".

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Petr Chmelar 2013-07-25 18:49:59 Re: BUG #8329: UPDATE x SET x.y = x.y + z does not work in PL/pgSQL
Previous Message Pavan Deolasee 2013-07-25 16:52:44 Re: BUG #8334: Merge Join drops records