Re: A small bug in gram.y

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Gokulakannan Somasundaram" <gokul007(at)gmail(dot)com>, "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A small bug in gram.y
Date: 2009-11-03 16:39:10
Message-ID: 4AF0084E020000250002C1AC@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>> LINE 1: SELECT 'aa' NOT SIMILAR TO 123;
>>> ^
>
>>> LINE 1: SELECT 'aa' SIMILAR TO 123;
>>> ^
>
>>> I think the former error location is better.
>
>> So do I.
>
> Uh, why? It looks like it's complaining about the constant 123,
> not about the operator.

I wrote that before I saw your post, which left me ambivalent. My
thinking was that it seems clearest to me when it points to the token
at which things become untenable. At this point there it is still
possible for the statement to be completed with a valid query:

SELECT 'aa' SIMILAR TO

At this point it is not:

SELECT 'aa' SIMILAR TO 123

If you had something like '123' instead of 123, it would be OK, so I'd
be good with it complaining about the constant 123.

SELECT 'aa' SIMILAR TO '123';
?column?
----------
f
(1 row)

But if we normally point to the operator when it isn't in the set
allowed with the given operands, then consistency trumps the above.
I yield the point.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-11-03 16:48:45 Re: A small bug in gram.y
Previous Message Dave Page 2009-11-03 16:37:29 Re: EOL for 7.4?