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.98.2) (envelope-from ) id 1x8eOz-00000001POX-3aMV for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Sep 2026 13:49:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x8eOy-00000009lzh-4AYj for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Sep 2026 13:49:49 +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.98.2) (envelope-from ) id 1x8eOy-00000009lzZ-37qw for pgsql-bugs@lists.postgresql.org; Mon, 21 Sep 2026 13:49:48 +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.98.2) (envelope-from ) id 1x8eOw-00000000X4I-0CPJ for pgsql-bugs@lists.postgresql.org; Mon, 21 Sep 2026 13:49:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68LDngCI635523; Mon, 21 Sep 2026 09:49:42 -0400 From: Tom Lane To: Ayush Tiwari cc: 2320415112@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19710: Incorrect DELETE result after LEFT JOIN optimization In-reply-to: References: <19710-08547ac48c09de62@postgresql.org> Comments: In-reply-to Ayush Tiwari message dated "Mon, 21 Sep 2026 14:24:08 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <635521.1789998582.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Sep 2026 09:49:42 -0400 Message-ID: <635522.1789998582@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ayush Tiwari writes: > On Mon, 21 Sept 2026 at 12:05, PG Bug reporting form > wrote: >> On PostgreSQL 17.10, a `DELETE` statement containing an `EXISTS` subque= ry >> with two `LEFT JOIN`s deletes a row even though the subquery predicate = is >> false. > AFAICS this has been fixed[1] and will be part of next minor versions. Yeah, this example is pretty nearly a duplicate of bug #19560 [1], which prompted that rewrite. regards, tom lane [1] https://www.postgresql.org/message-id/19560-54cd7ede78d5e355%40postgre= sql.org