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 1oVEnf-0001SB-BD for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Sep 2022 16:18:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVEnd-0006hf-Re for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Sep 2022 16:18:13 +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 1oVEnd-0006hT-JE for pgsql-bugs@lists.postgresql.org; Mon, 05 Sep 2022 16:18:13 +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 1oVEnY-0003Ni-RR for pgsql-bugs@lists.postgresql.org; Mon, 05 Sep 2022 16:18:10 +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 285GI4eA2439276; Mon, 5 Sep 2022 12:18:04 -0400 From: Tom Lane To: Richard Guo cc: 857348270@qq.com, PostgreSQL mailing lists Subject: Re: BUG #17606: There is still some glitch in 3f7323cbb fixing failure of MULTIEXPR_SUBLINK In-reply-to: <2435363.1662393106@sss.pgh.pa.us> References: <17606-e5c8ad18d31db96a@postgresql.org> <2435363.1662393106@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 05 Sep 2022 11:51:46 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2439274.1662394684.1@sss.pgh.pa.us> Date: Mon, 05 Sep 2022 12:18:04 -0400 Message-ID: <2439275.1662394684@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > No, that'll malfunction if there's a mix of initplan and subplan > MULTIEXPRs. I think we're going to have to bite the bullet and find a way > to discover the SubLinkIds of the non-initplan MULTIEXPRs, so that the > second loop can identify which Params to change and which not to. > AFAIR that info's no longer available by the time we get here, so > I imagine that a fix will require recording some more data during > SubLink-to-SubPlan conversion. After contemplating that for awhile, by far the least painful way seems to be to add the subLinkId to struct SubPlan. We can get away with that in the back branches as long as we add it at the end, since SubPlans don't get recorded in the catalogs. regards, tom lane