Re: BUG #8934: value != ANY (uuid[]) AND expr does not work in all cases

From: Marcus Overheu <marcusoverheu(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8934: value != ANY (uuid[]) AND expr does not work in all cases
Date: 2014-01-23 19:44:12
Message-ID: CAAe7igXbGqoxW-ctmM0LoyF-muTyPAhQE0jcH5DMrQU33bt5JQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yeah i noticed a bit too late, i apologize for not reading the
documentation properly.

2014/1/23 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>

> marcusoverheu(at)gmail(dot)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
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-01-23 20:23:54 Re: BUG #8939: Cast to range type fails due to whitespaces in the text string
Previous Message Alvaro Herrera 2014-01-23 17:48:29 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist