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.