Re: Weird behaviour of = ANY ( SUBQUERY ) ? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Weird behaviour of = ANY ( SUBQUERY ) ?
Date
Msg-id 14055.1254319091@sss.pgh.pa.us
Whole thread Raw
In response to Weird behaviour of = ANY ( SUBQUERY ) ?  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-bugs
hubert depesz lubaczewski <depesz@depesz.com> writes:
> Why this doesn't work:

> # SELECT 1 = ANY( ( SELECT '{1,2}'::int4[]) );
> ERROR:  operator does not exist: integer = integer[]
> LINE 1: SELECT 1 = ANY( ( SELECT '{1,2}'::int4[]) );
>                  ^

Why would you expect it to work?  The datatypes aren't compatible.

> direct usage of array of course works:
> # select 1 = any ( '{1,2}'::int4[] );

ANY with a sub-SELECT and ANY without one are two completely different
things.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Edinei"
Date:
Subject: BUG #5090: erro
Next
From: Isaac Morland
Date:
Subject: Bus Error in psql command history