Re: BUG #17842: Adding a qual to a working query gets bogus syntax error
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Hans Buschmann <buschmann@nidsa.net>,
PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Date: 2023-03-14T18:25:18Z
Lists: pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes: > On Tue, Mar 14, 2023, 11:12 Hans Buschmann <buschmann@nidsa.net> wrote: >> 2. Why is it reporting an syntax error (supposed at parse time) and not a >> runtime error (supposed at execution time) > Your parsed query doesn't have a syntax error. Data it processes does, > which is found when parsing that data during query execution. Right. It's kind of unfortunate perhaps that we use SQLSTATEs from the "syntax error" class for malformed data input, but that seems unlikely to change. In any case, it's pretty obvious that this error is not complaining about anything in the text of the query. regards, tom lane