IN with arrays - Mailing list pgsql-hackers

From Peter Eisentraut
Subject IN with arrays
Date
Msg-id 200704160848.55208.peter_e@gmx.net
Whole thread Raw
Responses Re: IN with arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I'm wondering why a IN b isn't equivalent to a = ANY b for arrays, as it 
is for subqueries.

That is, why can't you write

SELECT 1 IN ( ARRAY[1, 2, 3] );

when you can write

SELECT 1 = ANY ( ARRAY[1, 2, 3] );

?

I'm guessing that there is a semantic inconsistency between these 
expressions, as the first one considers what is in parentheses as a 
list, the second one as a single expression.  That would be very bad.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Build-Problem with pgc.c on OSX 10.4
Next
From: Heikki Linnakangas
Date:
Subject: Re: Adjusting index special storage for pg_filedump's convenience