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 1rvM9u-00BRXG-Of for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2024 19:01:59 +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 1rvM9t-00HBpX-Rr for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Apr 2024 19:01:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rvM9t-00HBpP-Jf for pgsql-bugs@lists.postgresql.org; Fri, 12 Apr 2024 19:01:57 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rvM9r-002Y8B-5L for pgsql-bugs@lists.postgresql.org; Fri, 12 Apr 2024 19:01:56 +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 43CJ1oGs481323; Fri, 12 Apr 2024 15:01:50 -0400 From: Tom Lane To: "David G. Johnston" cc: Benoit Ryder , "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #18429: Inconsistent results on similar queries with join lateral In-reply-to: References: <18429-8982d4a348cc86c6@postgresql.org> <441100.1712933417@sss.pgh.pa.us> <450117.1712937002@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Fri, 12 Apr 2024 08:57:58 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <481321.1712948510.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 12 Apr 2024 15:01:50 -0400 Message-ID: <481322.1712948510@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Fri, Apr 12, 2024 at 8:50 AM Tom Lane wrote: >> I'm not seeing a bulletproof way offhand, other than "update to v16". > Q1 is trivially fixed by specifying "WITH c2 AS MATERIALIZED ( ... )", No? Q1 as stated, yeah. But the question was about generically avoiding this bug, and I'm not yet sure about how to do that in cases not involving a WITH boundary (eg Q3,Q4). regards, tom lane