improve pgbench syntax error messages - Mailing list pgsql-hackers

From Fabien COELHO
Subject improve pgbench syntax error messages
Date
Msg-id alpine.DEB.2.10.1503030926440.5591@sto
Whole thread Raw
Responses Re: improve pgbench syntax error messages
List pgsql-hackers
Report the origin of syntax errors from pgbench.

Currently only the column number (for expressions) and command are 
essentially reported:
  sh> ./pgbench -f bad.sql  syntax error at column 14  set: parse error

The patch helps locate the origin of errors with the file name, line 
number and the actual text triggering the issue (either the line or an 
extract for expressions):
  sh> ./pgbench -f bad.sql  syntax error at column 14  error while processing "bad.sql" line 3: (1021 * :id) %  set:
parseerror
 

Whether using a macro is the right tool is debatable. The contents could 
be expanded, but that would mean replicating the same message over and 
over again, so it seems cleaner to me this way. An function seems 
overkill.

-- 
Fabien.

pgsql-hackers by date:

Previous
From: Vladimir Borodin
Date:
Subject: Re: pg_upgrade and rsync
Next
From: Kouhei Kaigai
Date:
Subject: Re: Join push-down support for foreign tables