Re: Document NULL

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, jian he <jian(dot)universality(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Subject: Re: Document NULL
Date: 2025-11-14 14:25:54
Message-ID: CAKFQuwZ+AfKe76W+csw0mwxMC0EWwDC-triOgVF66xq5pSuJsw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 14, 2025 at 1:52 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:

> > On Nov 11, 2025, at 23:34, Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
> >
> > On 2025-Jun-18, David G. Johnston wrote:
> >
> >> Version 8.
> >>
> >> Marking this Ready to Commit in CF 2025-09 (CF PG19-1)
> >
> > I have rebased this; here's v9. I haven't reviewed it in depth, but
> > intend to give it a read and get it pushed sometime in the
> > not-too-distant future, so if anybody wants to review it some more, it'd
> > be appreciated.
>
> I just reviewed this patch and got some comments:
>
> >
> > Note that this rebase was across the func.sgml split, which means I had
> > to do some "manual" merging. Looking at the git diff --stat output, it
> > seems to match what was there before, so I don't think anything was
> > lost.
>

Thanks for the review. Still on extended travel sabbatical until December
so my full attention may not yet be here; and am not able to resubmit a new
patch version right now. I'll do so in a couple of weeks, but appreciate
any assistance given.

>
> > --
> > Álvaro Herrera Breisgau, Deutschland —
> https://www.EnterpriseDB.com/
> > "Linux transformó mi computadora, de una `máquina para hacer cosas',
> > en un aparato realmente entretenido, sobre el cual cada día aprendo
> > algo nuevo" (Jaime Salinas)
> > <v9-0001-doc-Add-an-overview-of-NULL-treatment-in-PostgreS.patch>
>
> 1 - func-comparsions.sgml
> ```
> + tests are AND'd together. Note that <literal>IS DISTINCT
> FROM</literal> is not an operator.
> ```
>
> The “note that” sentence is not clear. I believe you meant to say the “IS
> DISTINCT FROM” cannot generate null values because it is not an operator.
> But one thing being not an operator doesn’t mean it cannot generate null
> value, right? So I think we’d be explicit, I am suggesting:
>
> "Note that, IS DISTINCT FROM does not produce null results — it always
> returns true or false."

> This comment applies to 2 occurrences.
>

Reading this again here, the first part where "operator cannot produce null
values" seems sufficient and calling out "is distinct from" can probably
just be removed instead of rephrased.

> 2 - func-comparsions.sgml
> ```
> + Each side is evaluated and they are compared row-wise.
> + As discussed and shown in <xref
> linkend="nullvalues-multielementcomparison-composite"/>,
> + null values are treated as being equal to other null values and greater
> + than all non-null values.
> + Composite type
> comparisons are allowed when the <replaceable>operator</replaceable> is
> ```
>
> The “composite type” line is too short, consider move the next line up.
>

Yeah, some of the lines are broken purely for review patch diff
considerations.

>
> For ANY, it should be “OR’d”.
>

I very well may have flipped the AND/ORs around.

> 8 - nullvalues.sgml
> ```
> + to any other value (e.g., <literal>IS DISTINCT</literal>, and
> <literal>IS TRUE</literal>.)
> ```
>
> Should “IS DISTINCT” be “IS DISTINCT FROM”?
>

Probably.

> 9 - nullvalues.sgml
> ```
> + all non-null valueS.
> ```
>
> Nit typo. Should be small “s".
>
>
Yeah.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Viktor Holmberg 2025-11-14 14:34:08 Re: ON CONFLICT DO SELECT (take 3)
Previous Message Daniel Gustafsson 2025-11-14 14:06:44 Uncommented GUC in postgresql.conf.sample