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.0208062227370.17111-100000@linuxworld.com.au
Whole thread Raw
In response to Re: Better handling of parse errors  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Tue, 6 Aug 2002, Bruce Momjian wrote:

> 
> Can we see some sample output?

template1=# select * frum pg_class;
ERROR:  parser: parse error at or near "frum" at character 10
template1=# select relname from pg_class a excepr select relname from
pg_class limit a;
ERROR:  parser: parse error at or near "excepr" at character 32
template1=# create table a (desc int);
ERROR:  parser: parse error at or near "desc" at character 17

Gavin

> 
> ---------------------------------------------------------------------------
> 
> Gavin Sherry wrote:
> > Hi all,
> > 
> > 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. It is not even close to an implementation of error handling
> > a-la SQL99 but it certainly makes debugging complicated queries easier.
> > 
> > I've done some testing and it appears to hit the offending token pretty
> > accurately.
> > 
> > Can anyone find a way to break this? If not, I'd love to see it in 7.3.
> > 
> > Gavin
> 
> Content-Description: 
> 
> [ Attachment, skipping... ]
> 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> > 
> > http://archives.postgresql.org
> 
> 



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Better handling of parse errors
Next
From: Gavin Sherry
Date:
Subject: Re: Better handling of parse errors