Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pc9Ku-0000ys-JO for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2023 18:25:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pc9Kt-0002rY-9q for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2023 18:25:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pc9Kt-0002rO-1R for pgsql-bugs@lists.postgresql.org; Tue, 14 Mar 2023 18:25:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pc9Kq-0003rD-Qq for pgsql-bugs@lists.postgresql.org; Tue, 14 Mar 2023 18:25:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32EIPINj2757855; Tue, 14 Mar 2023 14:25:18 -0400 From: Tom Lane To: "David G. Johnston" cc: Hans Buschmann , PostgreSQL Bug List Subject: Re: BUG #17842: Adding a qual to a working query gets bogus syntax error In-reply-to: References: <17842-0697f895ced573ee@postgresql.org> <2692255.1678810846@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Tue, 14 Mar 2023 11:19:32 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2757853.1678818318.1@sss.pgh.pa.us> Date: Tue, 14 Mar 2023 14:25:18 -0400 Message-ID: <2757854.1678818318@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Tue, Mar 14, 2023, 11:12 Hans Buschmann 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