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

From Jeff Davis
Subject Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Date
Msg-id 1288310602.20385.15.camel@jdavis-ux.asterdata.local
Whole thread Raw
In response to BUG #5732: parsing of: "WHERE mycol=123AND ..."  ("Josh Kupershmidt" <schmiddy@gmail.com>)
Responses Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-bugs
On Thu, 2010-10-28 at 23:46 +0000, Josh Kupershmidt wrote:
>   SELECT * FROM mytab WHERE mycol = 2OR true;

Is that inconsistent with the standard?

Other languages seem to allow similar things, such as ruby and perl. For
instance, in ruby:

  puts 1if(true)

seems to be acceptable.

> although some cases produce an error, as I would expect, such as:
>   SELECT * FROM mytab WHERE mycol = 2::intOR true;

That's not the same. In that example, there's no hope of distinguishing
the identifier "int" from the keyword "OR".

> I think it would be more consistent to raise syntax errors in all these
> cases.

I don't really see a "bug" here. Is this causing you some kind of
problem?

Regards,
    Jeff Davis

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Next
From: Tom Lane
Date:
Subject: Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."