Re: IN and ANY - Mailing list pgsql-hackers

From Joe Conway
Subject Re: IN and ANY
Date
Msg-id 4044AFD3.4080701@joeconway.com
Whole thread Raw
In response to Re: IN and ANY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: IN and ANY  (Dennis Bjorklund <db@zigo.dhs.org>)
List pgsql-hackers
Tom Lane wrote:
> I don't have a strong opinion about "IN array", but am worried that
> allowing it would create ambiguity about which interpretation is meant.
> Is the left-hand side supposed to be compared against the whole array or
> each array member?

That was exactly the problem. IN (array) does work if the left-hand side 
is also an array, and the right-hand side is taken as a value list:

regression=# select 1 where array[1] in (array[1]); ?column?
----------        1
(1 row)

regression=# select 1 where array[1] in (array[1,2]); ?column?
----------
(0 rows)

There was discussion on this back in the May-June 2003 timeframe -- 
please check the archives.

Joe


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [PATCHES] Foreign key type checking patch
Next
From: Stephan Szabo
Date:
Subject: Re: [PATCHES] Foreign key type checking patch