BUG #5732: parsing of: "WHERE mycol=123AND ..." - Mailing list pgsql-bugs

From Josh Kupershmidt
Subject BUG #5732: parsing of: "WHERE mycol=123AND ..."
Date
Msg-id 201010282346.o9SNkpOj074029@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Btree index left link changed unexpectedly after bringing up 8.3.11 warm standby
Next
From: Mark Kirkwood
Date:
Subject: Re: Btree index left link changed unexpectedly after bringing up 8.3.11 warm standby