> 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.