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 1ufKEE-005XvY-NH for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jul 2025 15:20: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 1ufKED-001v6j-Rq for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jul 2025 15:20:58 +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 1ufKED-001v6T-Jj for pgsql-bugs@lists.postgresql.org; Fri, 25 Jul 2025 15:20:57 +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 1ufKE8-000nUW-31 for pgsql-bugs@lists.postgresql.org; Fri, 25 Jul 2025 15:20:55 +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 56PFKltI1923878; Fri, 25 Jul 2025 11:20:48 -0400 From: Tom Lane To: "=?utf-8?B?SmluaHVpIExhaQ==?=" cc: "=?utf-8?B?cGdzcWwtYnVncw==?=" Subject: Re: BUG #18999: Equivalent queries processing WHERE IS NULL & WHERE IS NOT NULL produce mutually exclusive results In-reply-to: References: <18999-4dbdbaeafb1c1023@postgresql.org> <1856868.1753450099@sss.pgh.pa.us> Comments: In-reply-to "=?utf-8?B?SmluaHVpIExhaQ==?=" message dated "Fri, 25 Jul 2025 22:40:29 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1923876.1753456847.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Jul 2025 11:20:47 -0400 Message-ID: <1923877.1753456847@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "=3D?utf-8?B?SmluaHVpIExhaQ=3D=3D?=3D" writes: > Thanks for your reply, I get your detailed explanation. I also agree tha= t is weird. Especially, the the c0's constraint is NOT NULL. Yeah. We have adopted the policy that the spec's definition of this applies only to the specific SQL expression constructs "c IS NULL" and "c IS NOT NULL". Elsewhere we generally take the position that nullness is a simple boolean property: there is a value there, or there isn't. Whether a row value contains some null columns doesn't change that: if the container is there then it's not null. Legalistic reading of the spec text offers some support for this position, but I don't know whether the committee members actually think that way or just have failed to clarify the text enough. In any case, that's our position and we're quite unlikely to change it, for reasons of backwards compatibility and performance. regards, tom lane