From: Tom Lane <tgl@sss.pgh.pa.us>
To: László Lajos Jánszky <laszlo.janszky@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pgsql 8.4 "not" + "is contained by" operators return wrong result
Date: Thu, 25 Jul 2013 13:15:24 -0400
Message-ID: <21403.1374772524@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+=RcCoVbUhxMgRb_HauTs7rTLOKc2ud-L1UieL6GsCt4=e8HA@mail.gmail.com>
References: <CA+=RcCoVbUhxMgRb_HauTs7rTLOKc2ud-L1UieL6GsCt4=e8HA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
=?ISO-8859-1?Q?L=E1szl=F3_Lajos_J=E1nszky?= <laszlo.janszky@gmail.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, laszlo.janszky@gmail.com
Subject: Re: pgsql 8.4 "not" + "is contained by" operators return wrong result
In-Reply-To: <21403.1374772524@sss.pgh.pa.us>
References: <CA+=RcCoVbUhxMgRb_HauTs7rTLOKc2ud-L1UieL6GsCt4=e8HA@mail.gmail.com> <21403.1374772524@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox