Difference between "in (...)" and "= any(...)" queries when using arrays - Mailing list pgsql-general

From Francisco Figueiredo Jr.
Subject Difference between "in (...)" and "= any(...)" queries when using arrays
Date
Msg-id 438d02260905112209s74a71e9btd896387144077616@mail.gmail.com
Whole thread Raw
Responses Re: Difference between "in (...)" and "= any(...)" queries when using arrays
List pgsql-general
Hi all!

I was playing with "in (...)"  and "= any (...)" queries and found a
difference between them and I wonder:

why this works:

select * from table_of_integers where integer_column = any (array[5,6]);

and this doesn't:

select * from table_of_integers where integer_column in (array[5,6]);

Although documentation says:

9.20.4. ANY/SOME

[...]
SOME is a synonym for ANY. IN is equivalent to = ANY.
[...]

I thought that if IN is equivalent to = any, both queries above should work.

Am I missing something?

Thanks in advance.



--
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

pgsql-general by date:

Previous
From: Andrew Maclean
Date:
Subject: Re: Getting a list of encodings.
Next
From: Ow Mun Heng
Date:
Subject: Putting many related fields as an array