Re: Document NULL

From: Thom Brown <thom(at)linux(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Document NULL
Date: 2024-05-01 15:48:45
Message-ID: CAA-aLv72wmKQ8omwjVeJZq837_FQZmXZfoa=+nSyU3ENW-32Vg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 1, 2024, 16:13 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> Hi,
>
> Over in [1] it was rediscovered that our documentation assumes the reader
> is familiar with NULL. It seems worthwhile to provide both an introduction
> to the topic and an overview of how this special value gets handled
> throughout the system.
>
> Attached is a very rough draft attempting this, based on my own thoughts
> and those expressed by Tom in [1], which largely align with mine.
>
> I'll flesh this out some more once I get support for the goal, content,
> and placement. On that point, NULL is a fundamental part of the SQL
> language and so having it be a section in a Chapter titled "SQL Language"
> seems to fit well, even if that falls into our tutorial. Framing this up
> as tutorial content won't be that hard, though I've skipped on examples and
> such pending feedback. It really doesn't fit as a top-level chapter under
> part II nor really under any of the other chapters there. The main issue
> with the tutorial is the forward references to concepts not yet discussed
> but problem points there can be addressed.
>
> I do plan to remove the entity reference and place the content into
> query.sgml directly in the final version. It is just much easier to write
> an entire new section in its own file.
>
> David J.
>
> [1]
> https://www.postgresql.org/message-id/1859814.1714532025%40sss.pgh.pa.us
>

"The cardinal rule, NULL is never equal or unequal to any non-null value."

This implies that a NULL is generally equal or unequal to another NULL.
While this can be true (e.g. in aggregates), in general it is not. Perhaps
immediately follow it with something along the lines of "In most cases NULL
is also not considered equal or unequal to any other NULL (i.e. NULL = NULL
will return NULL), but there are occasional exceptions, which will be
explained further on."

Regards

Thom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amonson, Paul D 2024-05-01 15:56:08 Proposal for Updating CRC32C with AVX-512 Algorithm.
Previous Message Thomas Spear 2024-05-01 15:17:13 Re: TLS certificate alternate trust paths issue in libpq - certificate chain validation failing