Re: Better handling of parse errors

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


Gavin, have you answered these issues brought up about the patch?

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

Tom Lane wrote:
> Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> > Attached is a small patch to scan.l for consideration. It hands
> > yyerror() the position in the query string of the token which caused a
> > parse error.
>
> Isn't that the hard way to do it? Seems like you could just subtract
> scanbuf from the error pointer, instead of adding overhead to the basic
> lex loop.
>
> Things that need to be decided (and documented somewhere):
>
> Is the number an offset (counted from 0) or an index (counted from 1)?
> Which end of the token does it point at? Can the message be phrased
> so as to make it reasonably clear what the number is?
>
>
> A related change I'd been meaning to make is to get it to say
> parse error at end of input
> when that's the case, rather than the rather useless
> parse error at or near ""
> that you get now. I'd still be inclined to just say "end of input"
> in that case, and not bother with a character count.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-08-14 05:14:55 Re: journaling in contrib ...
Previous Message Bruce Momjian 2002-08-14 04:59:56 Re: Antw: PostgreSQL and Novell Netware

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-14 05:10:29 Re: Documentation update (pg_get_fkeydef, current_database)
Previous Message Bruce Momjian 2002-08-14 03:36:04 Re: [SQL] 16 parameter limit