From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: marcusoverheu@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8934: value != ANY (uuid[]) AND expr does not work in all cases
Date: Thu, 23 Jan 2014 14:11:24 -0300
Message-ID: <20140123171124.GR10723@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <20140123094712.26700.15844@wrigleys.postgresql.org>
References: <20140123094712.26700.15844@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
marcusoverheu@gmail.com escribió:
> insert into uuidtest VALUES (1, 'ab15ea27-8768-4cbe-a1fb-02a2a949a34d'),
> (1, '1c9e9ce5-d4d8-4a14-9eaf-929f27e09ba2');
>
> then
> select * from uuidtest where auuid = ANY
> (ARRAY['1c9e9ce5-d4d8-4a14-9eaf-929f27e09ba2','ab15ea27-8768-4cbe-a1fb-02a2a949a34d']::uuid[])
> and aint = 1;
> return 2 result
> which would mean that if using not in
>
> select * from uuidtest where auuid != ANY
> (ARRAY['1c9e9ce5-d4d8-4a14-9eaf-929f27e09ba2','ab15ea27-8768-4cbe-a1fb-02a2a949a34d']::uuid[])
> and aint = 1;
Presumably you want auuid != ALL (array[ .. ]) here. In the first case,
each value is = to the value that it equals to, so both are returned.
In the second case, each value is != to the other value, so both are
returned too.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
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: alvherre@2ndquadrant.com, marcusoverheu@gmail.com
Subject: Re: BUG #8934: value != ANY (uuid[]) AND expr does not work in all cases
In-Reply-To: <20140123171124.GR10723@eldon.alvh.no-ip.org>
References: <20140123094712.26700.15844@wrigleys.postgresql.org> <20140123171124.GR10723@eldon.alvh.no-ip.org>
* 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