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 1oM90C-0000Rq-KL for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 14:17:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oM909-00024x-Pm for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Aug 2022 14:17:33 +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 1oM909-00024n-DZ for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 14:17:33 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oM906-0004mo-Jg for pgsql-bugs@lists.postgresql.org; Thu, 11 Aug 2022 14:17:32 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D26C35C0060; Thu, 11 Aug 2022 10:17:28 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 11 Aug 2022 10:17:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1660227448; x=1660313848; bh=g Me4+DcrUiBz4d82JeRS7Ca31G4X0seMIjoxUR5B4Uk=; b=fvX2ESFjVjNygbPWM G1dVfJlGZd8akHDL5s+hZlxe4n9B3QwPTEIgLsuf2dNwB2x+Qb3Qo6U4nVnpq4d1 C/hLcX/6R/gkpsD0dEYIrXIypz0QVWXRck3jZoR6KS5BCYbfd2LRROLDpX3yV2ug 9Xt9ttT9ismYdfsIq3xgrlZep0RWVC1dOU6WMGFgp7uMV74z9qGYIjScE1gHuuSA cIS92oxn6l44KwJssoshUwOHPah2gZpMbT0hSFeW6hYg4cyrd0qH4FWh+o6je4AM br43XsbmwDsH0A4vIsMcOrgBUkH1+nJzS8g6sC06GlubQ+fSr9UXw6BP4RL7sqFV mt95w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeggedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduff dtffffheffhfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhep vghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhr gh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Aug 2022 10:17:27 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 83B9E376; Thu, 11 Aug 2022 16:17:45 +0200 (CEST) Date: Thu, 11 Aug 2022 16:17:45 +0200 From: Alvaro Herrera To: Tom Lane 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 Message-ID: <20220811141745.pdor4vr2ktuauygk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <481803.1660225028@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk In the meantime I noticed that DoCopy is subject to the same problem, since it also uses PreparableStmt. I'll post a patch in a bit. 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 :-( 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. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli)