Re: improve pgbench syntax error messages - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: improve pgbench syntax error messages
Date
Msg-id alpine.DEB.2.10.1503042213120.21747@sto
Whole thread Raw
In response to Re: improve pgbench syntax error messages  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: improve pgbench syntax error messages
List pgsql-hackers
> Indeed. Here is a v2.

Here is a v3, which (1) activates better error messages from bison
and (2) improves the error reporting from the scanner as well.

>  sh> ./pgbench -f bad.sql
>  bad.sql:3: syntax error at column 23 in command "set"
>  \set aid (1021 * :id) %
>                        ^ error found here

the improved message is:  bad.sql:3: syntax error, unexpected $end at column 23 in command "set"  \set aid (1021 * :id)
%                       ^ error found here
 

Also scanner errors are better:
  sh> ./pgbench -f bad5.sql  bad5.sql:1: unexpected character (a) at column 12 in command "set"  \set foo 12abc
   ^ error found here
 

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: xpath changes in the recent back branches
Next
From: Stephen Frost
Date:
Subject: Re: MD5 authentication needs help