From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Hutt <tdhutt@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13832: Syntax errors are extremely unfriendly
Date: Mon, 28 Dec 2015 15:03:42 -0500
Message-ID: <24516.1451333022@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKuVd4AafYiCafieV03AEguXKoiFGEzk0Z5zpccw1+A3+0hChg@mail.gmail.com>
References: <20151224104428.2673.7170@wrigleys.postgresql.org>
<1419.1450973473@sss.pgh.pa.us>
<CAKuVd4AafYiCafieV03AEguXKoiFGEzk0Z5zpccw1+A3+0hChg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tim Hutt <tdhutt@gmail.com> writes:
> On 24 Dec 2015 16:11, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
>> As far as raw syntax errors go, we're pretty much limited by what Bison
>> will do; we're unlikely to implement our own parser from scratch just
>> to improve this. We do go to considerable lengths for semantic errors...
> Ah OK I guess this is an issue with Bison - theoretically it should be able
> to say what it expects when it gets an invalid token right?
You would think. I've experimented with Bison's %error-verbose directive,
but if anything its results are worse than doing nothing: it seems to
mention only a rather randomly-chosen subset of the possible
continuations. (That seems to be related to their decision to put a
fairly small hard limit on the length of their error messages, but even
allowing for that, what you get seems pretty random.) It's also
depressingly concrete; instead of something useful like "expected a table
name here", you get "expected IDENT or ABORT or ABSOLUTE or (all possible
unreserved keywords...) here", or at least that's what you would get if
not for the aforesaid problem.
There's been some recent chat in the PG mailing lists about whether we
could extract tab-completion logic from the grammar specification, which
is sort of related to this issue. We've not gotten far with that idea
unfortunately.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, tdhutt@gmail.com
Subject: Re: BUG #13832: Syntax errors are extremely unfriendly
In-Reply-To: <24516.1451333022@sss.pgh.pa.us>
References: <20151224104428.2673.7170@wrigleys.postgresql.org> <1419.1450973473@sss.pgh.pa.us> <CAKuVd4AafYiCafieV03AEguXKoiFGEzk0Z5zpccw1+A3+0hChg@mail.gmail.com> <24516.1451333022@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox