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 1ozqIF-00038m-FI for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2022 02:24:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozqIE-0007R7-94 for pgsql-bugs@arkaria.postgresql.org; Tue, 29 Nov 2022 02:24:18 +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 1ozqIE-0007Qn-11 for pgsql-bugs@lists.postgresql.org; Tue, 29 Nov 2022 02:24:18 +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 1ozqIA-00068t-JV for pgsql-bugs@lists.postgresql.org; Tue, 29 Nov 2022 02:24:16 +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 2AT2ODvB793072; Mon, 28 Nov 2022 21:24:13 -0500 From: Tom Lane To: Richard Guo cc: Daniel Gustafsson , xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17700: An assert failed in prepjointree.c In-reply-to: References: <17700-2b5c10d917c30687@postgresql.org> <556194.1669649617@sss.pgh.pa.us> <627613.1669652527@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 29 Nov 2022 10:19:00 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <793070.1669688653.1@sss.pgh.pa.us> Date: Mon, 28 Nov 2022 21:24:13 -0500 Message-ID: <793071.1669688653@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > BTW, for the test case > +explain (verbose, costs off) > +with ctetable as not materialized ( select 1 as f1 ) > +select * from ctetable c1 > +where f1 in ( select c3.f1 from ctetable c2 full join ctetable c3 on true > ); > Actually we just need to keep 'c3' in a join's nullable side to have the > PHV created. So we don't have to use full join in the subquery. A left > join would do. Actually, the planner reduces the full join to left join anyway; if it did not, it wouldn't be able to reach the code in question. I think this formulation is fine because it tests that step along with the bug proper. regards, tom lane