BUG #5732: parsing of: "WHERE mycol=123AND ..."

From: "Josh Kupershmidt" <schmiddy(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Date: 2010-10-28 23:46:51
Message-ID: 201010282346.o9SNkpOj074029@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5732
Logged by: Josh Kupershmidt
Email address: schmiddy(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mark Kirkwood 2010-10-28 23:57:19 Re: Btree index left link changed unexpectedly after bringing up 8.3.11 warm standby
Previous Message Tom Lane 2010-10-28 21:27:47 Re: Btree index left link changed unexpectedly after bringing up 8.3.11 warm standby