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.1503041720550.15572@sto
Whole thread Raw
In response to Re: improve pgbench syntax error messages  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: improve pgbench syntax error messages
List pgsql-hackers
> As I mentioned on the other thread, I'd really like to get this into a
> better format, where each error message is on one line.  Looking at
> that, you can't tell whether you've got one mistake, two mistakes, or
> three mistakes.

Indeed. Here is a v2.
  sh> ./pgbench -f bad.sql  bad.sql:3: syntax error at column 23 in command "set"  \set aid (1021 * :id) %
         ^ error found here
 
  sh> ./pgbench -f bad2.sql  bad2.sql:1: unexpected argument (x) at column 25 in command "setrandom"     \setrandom id
11000 x                          ^ error found here
 
  sh> ./pgbench -f bad3.sql  bad3.sql:1: too many arguments (gaussian) at column 35 in command "setrandom"  \setrandom
foo1 10 gaussian 10.3 1                                    ^ error found here
 
 sh> ./pgbench -f bad4.sql  bad4.sql:1: missing threshold argument (exponential) in command "setrandom"  \setrandom foo
110 exponential
 


I think that transforming unexpected garbage in errors would be a good 
move, even if this breaks backwards compatibility (currently a warning is 
printed about ignored extra stuff).

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: xpath changes in the recent back branches
Next
From: Robert Haas
Date:
Subject: Re: failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)