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 1oM96B-0000fc-Qz for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 14:23:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oM96A-00061U-Ls for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 14:23:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM96A-00061J-D8 for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 14:23:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM968-0004qc-Bh for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 14:23:46 +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 27BENF4a485521; Thu, 11 Aug 2022 10:23:15 -0400 From: Tom Lane To: Alvaro Herrera cc: Richard Guo , borz_off@cs.msu.su, PostgreSQL mailing lists Subject: Re: BUG #17579: 15beta2: strange error when trying to use MERGE statement as a CTE In-reply-to: <20220811141745.pdor4vr2ktuauygk@alvherre.pgsql> References: <20220811141745.pdor4vr2ktuauygk@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 11 Aug 2022 16:17:45 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <485519.1660227795.1@sss.pgh.pa.us> Date: Thu, 11 Aug 2022 10:23:15 -0400 Message-ID: <485520.1660227795@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2022-Aug-11, Tom Lane wrote: >> The parse error location seems quite oddly chosen. Can you make >> it point at the MERGE instead? I think exprLocation(cte->ctequery) >> might work, but not sure. > I tried, but couldn't find the location anywhere. None of the nodes for > ModifyTable statements have location :-( Ah, right, in particular MergeStmt doesn't. > We could add one now -- while > it's a bit late for 15, we're likely going to have a catversion bump due > to the JSON revert, so it might be fine. Nah, not worth it just for this. regards, tom lane