The following bug has been logged online:
Bug reference: 2889
Logged by: David
Email address: higgsd(at)gmail(dot)com
PostgreSQL version: 8.1.5
Operating system: OpenBSD 3.9
Description: Syntax error: WHERE ANY(arrayfield) = N
Details:
In reference to the array documentation at:
http://www.postgresql.org/docs/8.1/static/arrays.html#AEN5698
This statement works:
=> SELECT * FROM sal_emp WHERE 10000 = ANY (pay_by_quarter);
But this does not:
=> SELECT * FROM sal_emp WHERE ANY (pay_by_quarter) = 10000;
ERROR: syntax error at or near "ANY" at character ...
The ANY operator has the same problem, others may as well.
While trivial to work around, it is certainly annoying and I can't think of
a good reason why it shouldn't work either way.