Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group