Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utSus-007mZG-6t for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Sep 2025 15:27:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1utSur-004GWc-Ag for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Sep 2025 15:27:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1utSur-004GWU-2Z for pgsql-bugs@lists.postgresql.org; Tue, 02 Sep 2025 15:27:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1utSun-000C13-3C for pgsql-bugs@lists.postgresql.org; Tue, 02 Sep 2025 15:27:25 +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 582FRFtc589703; Tue, 2 Sep 2025 11:27:15 -0400 From: Tom Lane To: Richard Guo cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19037: Planner fails on estimating array length with "no relation entry" error In-reply-to: References: <19037-3d1c7bb553c7ce84@postgresql.org> <50858.1756590676@sss.pgh.pa.us> <346889.1756738657@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 02 Sep 2025 15:49:51 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <589701.1756826835.1@sss.pgh.pa.us> Date: Tue, 02 Sep 2025 11:27:15 -0400 Message-ID: <589702.1756826835@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Here is the patch that passes root as NULL to cost_qual_eval() in > cost_subplan(), along with some commentary about why. v2 LGTM. I did think of a way to make the test case a little less busy-looking: select (1 = any(array_agg(f1))) = any (select false) from int4_tbl; but that's just cosmetic. regards, tom lane