Re: Document NULL

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: jian he <jian(dot)universality(at)gmail(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>
Subject: Re: Document NULL
Date: 2024-12-09 16:31:03
Message-ID: CAKFQuwagLjzB1kqQgq1HoPkYC7O0Lh=XJ8vVea1fne3aci98vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 21, 2024 at 8:03 AM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:

> Em qui., 21 de nov. de 2024 às 11:42, David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> escreveu:
>
>>
>> I'm not following your train of thought here. Since null == null in
>> json-land there isn't a need for or concept of "is distinct from". We tend
>> to not expend space on pointing out things that don't exist.
>>
>
> But you said previously in this document about IS DISTINCT, so it's
> related to NULL. I thought it would be better to mention that here, for
> JSON PATH, that way doesn't exist.
>
> "JSON null value is considered equal to other JSON null values, so here we
> don't have the IS DISTINCT operator"
>
>
I added this to "Overview"

<para>
Throughout this section the discussion of null values will be limited to
the SQL language unless otherwise noted. The JSON-related data types,
and the
non-SQL procedural languages, have their own behaviors documented in their
respective areas.
</para>

And added this to "Distinctness..."

<para>
On the other hand, the SQL specification is largely alone in taking this
approach to comparing
values to the null value. Specifically, when working within the JSON
data types the use of equals
produces true or false and so the concept of distinctness is neither
present nor required. Please
consult the documentation for the non-SQL procedural language of choice
to learn about its behavior.
</para>

I'm OK with adding more cross-references (links or just brief comparative
verbiage like the above) to non-SQL null value treatment but this document,
for this patch, is going to focus solely on SQL NULL.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-12-09 16:31:26 Re: FileFallocate misbehaving on XFS
Previous Message jian he 2024-12-09 16:16:00 Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays