Re: BUG #14883: Syntax SQL error (42601), but should be a different error no

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: stefan(dot)hanenberg(at)googlemail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14883: Syntax SQL error (42601), but should be a different error no
Date: 2017-10-31 02:07:23
Message-ID: CAKFQuwacR75ao3R4s7hOor8VgL5nL2VA5KRBDU+WgVvFSvhzfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Oct 30, 2017 at 6:35 PM, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
wrote:

> On 31 October 2017 at 13:36, <stefan(dot)hanenberg(at)googlemail(dot)com> wrote:
> > The following SQL statement leads to an error 42601 (syntax error),
> although
> > the error is not a syntax error.
>
> > We are currently running automated tests on hundreds of thousands SQL in
> > order to check, what kind of errors they contain. It is really
> problematic
> > for us that the error is a 42601 error, although it seems rather as if
> it is
> > a type error.
>
> then a syntax error seems a bit more reasonable.
>

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.

That said, I can make an argument for 42804 (datatype_mismatch) - which
still has a syntax error classification - since the implicit row-types from
the two input relations do not match each other.

The example error would read:

UNION types (int, int) and (int, int, int) cannot be matched

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-10-31 02:50:11 Re: BUG #14883: Syntax SQL error (42601), but should be a different error no
Previous Message David Rowley 2017-10-31 01:35:17 Re: BUG #14883: Syntax SQL error (42601), but should be a different error no