Re: [HACKERS] improve pgbench syntax error messages

2015-04-26 Thread Fabien COELHO
Here is v6, just a rebase. Committed with minor stylistic fixes. Thanks! -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] improve pgbench syntax error messages

2015-04-02 Thread Robert Haas
On Sun, Mar 29, 2015 at 2:20 PM, Fabien COELHO coe...@cri.ensmp.fr wrote: Here is a v5. Here is v6, just a rebase. Committed with minor stylistic fixes. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list

Re: [HACKERS] improve pgbench syntax error messages

2015-03-29 Thread Fabien COELHO
Here is a v5. Here is v6, just a rebase. -- Fabien.diff --git a/contrib/pgbench/exprparse.y b/contrib/pgbench/exprparse.y index e68631e..68c85c9 100644 --- a/contrib/pgbench/exprparse.y +++ b/contrib/pgbench/exprparse.y @@ -26,6 +26,13 @@ static PgBenchExpr *make_op(char operator,

Re: [HACKERS] improve pgbench syntax error messages

2015-03-11 Thread Fabien COELHO
Hello, Here is a v5. While adding a basic function call syntax to expressions, a noticed that it would be useful to access the detail field of syntax errors so as to report the name of the unknown function. This version just adds the hook (expr_yyerror_detailed) that could be called later for

Re: [HACKERS] improve pgbench syntax error messages

2015-03-11 Thread Robert Haas
On Sat, Mar 7, 2015 at 5:49 AM, Fabien COELHO coe...@cri.ensmp.fr wrote: Here is a v3, which (1) activates better error messages from bison and (2) improves the error reporting from the scanner as well. v4. While adding a basic function call syntax to expressions, a noticed that it would be

Re: [HACKERS] improve pgbench syntax error messages

2015-03-07 Thread Fabien COELHO
Here is a v3, which (1) activates better error messages from bison and (2) improves the error reporting from the scanner as well. v4. While adding a basic function call syntax to expressions, a noticed that it would be useful to access the detail field of syntax errors so as to report the

Re: [HACKERS] improve pgbench syntax error messages

2015-03-04 Thread Fabien COELHO
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

Re: [HACKERS] improve pgbench syntax error messages

2015-03-04 Thread Fabien COELHO
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

Re: [HACKERS] improve pgbench syntax error messages

2015-03-04 Thread Robert Haas
On Tue, Mar 3, 2015 at 3:48 AM, Fabien COELHO coe...@cri.ensmp.fr wrote: 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

[HACKERS] improve pgbench syntax error messages

2015-03-03 Thread Fabien COELHO
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