Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be adifferent error no - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be adifferent error no
Date
Msg-id CAKFQuwacR75ao3R4s7hOor8VgL5nL2VA5KRBDU+WgVvFSvhzfw@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be adifferent error no  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be a different error no
List pgsql-bugs
On Mon, Oct 30, 2017 at 6:35 PM, David Rowley <david.rowley@2ndquadrant.com> wrote:
On 31 October 2017 at 13:36,  <stefan.hanenberg@googlemail.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.

pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be adifferent error no
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14883: Syntax SQL error (42601), but should be a different error no