Re: improve pgbench syntax error messages

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: improve pgbench syntax error messages
Date: 2015-03-04 14:58:06
Message-ID: CA+Tgmob3D2qTjFuWWK5f3ECoVW6hsqz4OwCnqXwmhdczTJNPLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 3, 2015 at 3:48 AM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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 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: parse error
>
> 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.

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.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-03-04 14:59:09 Re: Bootstrap DATA is a pita
Previous Message Robert Haas 2015-03-04 14:55:01 Re: Bootstrap DATA is a pita