pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jinhui Lai <jinhui-lai@foxmail.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18999: Equivalent queries processing WHERE IS NULL & WHERE IS NOT NULL produce mutually exclusive results
Date: Fri, 25 Jul 2025 11:20:47 -0400
Message-ID: <1923877.1753456847@sss.pgh.pa.us> (raw)
In-Reply-To: <tencent_40B5E802081EE140CD8433AB8A30002DDF06@qq.com>
References: <18999-4dbdbaeafb1c1023@postgresql.org>
	<1856868.1753450099@sss.pgh.pa.us>
	<tencent_40B5E802081EE140CD8433AB8A30002DDF06@qq.com>

"=?utf-8?B?SmluaHVpIExhaQ==?=" <jinhui-lai@foxmail.com> writes:
> Thanks for your reply, I get your detailed explanation. I also agree that 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





view thread (5+ messages)  latest in thread

Message-ID: <1923877.1753456847@sss.pgh.pa.us>
Permalink:  ../1923877.1753456847@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1923877.1753456847@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jinhui-lai@foxmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18999: Equivalent queries processing WHERE IS NULL & WHERE IS NOT NULL produce mutually exclusive results
  In-Reply-To: <1923877.1753456847@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox