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

From: Gary Doades <gpd(at)gpdnet(dot)co(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."
Date: 2010-10-30 18:32:20
Message-ID: 4CCC64B4.9030004@gpdnet.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

MS SQL server 2008 has no problem with this:

select * from client where CLIENT_ID = 12AND SNAME='Smith'

Returns the expected row.

PostgreSQL 9.0 has no problem with it either, again throwing no error
and returning the expected result.

Regards,
Gary.

On 30/10/2010 7:23 PM, Tom Lane wrote:
> Greg Stark<gsstark(at)mit(dot)edu> writes:
>> On Thu, Oct 28, 2010 at 5:20 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I experimented a bit with mysql's behavior, and it seems that (at least
>>> in 5.1.51) what they do is treat "1and" or "2or" as if it were an
>>> identifier. They're definitely not throwing an error, at least not on
>> I guess the eleant question is what the lexical elements section of
>> the standard says about identifiers. It pretty clearly declares that
>> they can't start with digits:
> Yeah. The key point IMO is that this *input* is not spec-compliant.
> So implementations can either throw an error, or define their own
> spec extension as to how to interpret it. I find mysql's behavior
> interesting mostly because it shows that throwing an error isn't
> necessarily common practice. Anybody want to try Oracle, DB2, etc?
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Henry 2010-10-30 19:18:59 BUG #5736: 9.0.1 segmentation fault (sig11) during long-lived update
Previous Message Tom Lane 2010-10-30 18:23:51 Re: BUG #5732: parsing of: "WHERE mycol=123AND ..."