Re: Better handling of parse errors - Mailing list pgsql-hackers

From Gavin Sherry
Subject Re: Better handling of parse errors
Date
Msg-id Pine.LNX.4.21.0208150025360.24839-101000@linuxworld.com.au
Whole thread Raw
In response to Re: Better handling of parse errors  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Better handling of parse errors  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Better handling of parse errors  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: [PATCHES] Better handling of parse errors  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Wed, 14 Aug 2002, Tom Lane wrote:

> Gavin Sherry <swm@linuxworld.com.au> writes:
> > ... do we want to modify every 7.2 error message?
>
> Nyet ... but I don't think tacking an offset onto the end of
> "parse error at or near foo" messages is likely to cause the
> sort of generalized havoc you suggest ...

In that case, attached is a patch which locates the beginning of the
offending token more efficiently (per your suggestion of using
scanbuf). The new patch does the same as before:

template1=# select * frum pg_class;
ERROR:  parser: parse error at or near "frum" at character 10

It also implement's Tom's suggestion:

template1=# select * from pg_class where\g
ERROR:  parse: parse error at end of input

Gavin

pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Open 7.3 items
Next
From: Greg Copeland
Date:
Subject: Re: Inheritance