Re: A small bug in gram.y

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
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 17:09:31
Message-ID: 6933.1257268171@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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.

Our error pointers are *not* about how far to the right did parsing
get, they're about which part of the construct seems to be most
directly related to the problem. Otherwise most of them would point
at the ending semicolon ;-). A possibly less flippant example is

select nosuchfunction(1,2,3,avalidfunction(4));
^

select nosuchfunction(1,2,3,avalidfunction(4));
^

Which of these is less likely to be misread about which function is
being complained of?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-11-03 17:13:16 Re: EOL for 7.4?
Previous Message Heikki Linnakangas 2009-11-03 17:07:31 Re: A small bug in gram.y