The following bug has been logged online:
Bug reference: 5732
Logged by: Josh Kupershmidt
Email address: schmiddy@gmail.com
PostgreSQL version: 8.3 and HEAD
Operating system: Linux and OS X
Description: parsing of: "WHERE mycol=123AND ..."
Details:
I noticed that Postgres in many cases will happily tokenize WHERE clauses
having no space between a condition and "AND" or "OR".
For example:
CREATE TABLE mytab (mycol int);
INSERT INTO mytab (mycol) VALUES (1), (2);
SELECT * FROM mytab WHERE mycol = 1AND true;
SELECT * FROM mytab WHERE mycol = 2OR true;
although some cases produce an error, as I would expect, such as:
SELECT * FROM mytab WHERE mycol = 2::intOR true;
I think it would be more consistent to raise syntax errors in all these
cases.
Josh