Re: Document NULL - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Document NULL
Date
Msg-id CAKFQuwagLjzB1kqQgq1HoPkYC7O0Lh=XJ8vVea1fne3aci98vQ@mail.gmail.com
Whole thread Raw
In response to Re: Document NULL  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: Document NULL
List pgsql-hackers
On Thu, Nov 21, 2024 at 8:03 AM Marcos Pegoraro <marcos@f10.com.br> wrote:
Em qui., 21 de nov. de 2024 às 11:42, David G. Johnston <david.g.johnston@gmail.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.

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: FileFallocate misbehaving on XFS
Next
From: Andres Freund
Date:
Subject: Re: FileFallocate misbehaving on XFS