Re: IN and ANY

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IN and ANY
Date: 2004-03-02 16:01:23
Message-ID: 4044AFD3.4080701@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Patnude 2004-03-02 16:23:16 Re: User defined types -- Social Security number...
Previous Message Fabien COELHO 2004-03-02 15:59:58 Re: [PATCHES] Foreign key type checking patch