Re: Weird behaviour of = ANY ( SUBQUERY ) ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Weird behaviour of = ANY ( SUBQUERY ) ?
Date: 2009-09-30 13:58:11
Message-ID: 14055.1254319091@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

hubert depesz lubaczewski <depesz(at)depesz(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Isaac Morland 2009-09-30 19:30:23 Bus Error in psql command history
Previous Message the6campbells 2009-09-30 12:49:13 BUG #5091: sqlDescribeCol incorrectly setting null flag for projection of a view