Re: [HACKERS] Better handling of parse errors

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(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-17 13:06:57
Message-ID: 200208171306.g7HD6vS06878@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Gavin Sherry wrote:
> 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

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-17 13:55:47 Re: Removing Libraries (Was: Re: Open 7.3 issues)
Previous Message Philip Warner 2002-08-17 07:09:01 Re: Function result cacheing

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-17 13:17:10 Re: updated lock listing patch
Previous Message Bruce Momjian 2002-08-17 13:04:26 Re: updated lock listing patch