Re: [HACKERS] Better handling of parse errors

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Better handling of parse errors
Date: 2002-08-14 14:30:36
Message-ID: Pine.LNX.4.21.0208150025360.24839-101000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, 14 Aug 2002, Tom Lane wrote:

> Gavin Sherry <swm(at)linuxworld(dot)com(dot)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

Attachment Content-Type Size
scanner2.diff.gz application/x-gzip 358 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-08-14 14:35:10 Re: Inheritance
Previous Message Greg Copeland 2002-08-14 14:25:02 Re: OOP real life example (was Re: Why is MySQL more

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-08-14 14:57:17 Re: improve FOUND in PL/PgSQL
Previous Message Tom Lane 2002-08-14 14:05:19 Re: Foreign key in pg_dump / psql