From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: stefan.hanenberg@googlemail.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14883: Syntax SQL error (42601), but should be a different error no
Date: Mon, 30 Oct 2017 22:50:11 -0400
Message-ID: <23556.1509418211@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwacR75ao3R4s7hOor8VgL5nL2VA5KRBDU+WgVvFSvhzfw@mail.gmail.com>
References: <20171031003601.17181.3817@wrigleys.postgresql.org>
<CAKJS1f-30JFzWsuSmHzRb2KJxQWZ57qxtEEXd4FXMDm4PfMHcQ@mail.gmail.com>
<CAKFQuwacR75ao3R4s7hOor8VgL5nL2VA5KRBDU+WgVvFSvhzfw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Someone familiar with the SQL standard would need to confirm that our
> choice in this case is not governed by the standard before I'd consider
> changing it.
The SQL committee takes basically no interest in this area: their
taxonomy for syntax & semantic analysis errors consists of
(wait for it...)
Class 42 syntax error or access rule violation
with exactly no standard-defined subclasses. Whatever implementations
do to distinguish different subcategories is up to them (although IIRC
we borrowed some of our subcategories from DB2, so they're not things
we came up with out of noplace).
I agree that there's some case for considering this to be
ERRCODE_DATATYPE_MISMATCH, but I'm not sure that the case is strong
enough to justify a compatibility break from changing it.
More generally, there are a *lot* of ERRCODE_SYNTAX_ERROR calls in
the backend that could arguably be changed to something more specific,
even without inventing any new subcategories for the purpose. If we were
to decide that we're willing to make a compatibility break here, I'd
rather see a patch that goes through all of them and changes what seems
reasonable. Better a big break than drip drip drip ...
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, david.g.johnston@gmail.com, david.rowley@2ndquadrant.com
Subject: Re: BUG #14883: Syntax SQL error (42601), but should be a different error no
In-Reply-To: <23556.1509418211@sss.pgh.pa.us>
References: <20171031003601.17181.3817@wrigleys.postgresql.org> <CAKJS1f-30JFzWsuSmHzRb2KJxQWZ57qxtEEXd4FXMDm4PfMHcQ@mail.gmail.com> <CAKFQuwacR75ao3R4s7hOor8VgL5nL2VA5KRBDU+WgVvFSvhzfw@mail.gmail.com> <23556.1509418211@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