Re: [HACKERS] IN with arrays

2007-04-16 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > 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] ); > ? The two syntaxes are in fact *not* equivalent according to SQL92. = ANY derives from ::=

[HACKERS] IN with arrays

2007-04-15 Thread Peter Eisentraut
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