Re: BUG #17842: Adding a qual to a working query gets bogus syntax error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Hans Buschmann <buschmann(at)nidsa(dot)net>, PostgreSQL Bug List <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17842: Adding a qual to a working query gets bogus syntax error
Date: 2023-03-14 18:25:18
Message-ID: 2757854.1678818318@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Tue, Mar 14, 2023, 11:12 Hans Buschmann <buschmann(at)nidsa(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hans Buschmann 2023-03-14 19:07:59 AW: BUG #17842: Adding a qual to a working query gets bogus syntax error
Previous Message David G. Johnston 2023-03-14 18:19:32 Re: BUG #17842: Adding a qual to a working query gets bogus syntax error