0002-v9-edit.patch

text/x-patch

Filename: 0002-v9-edit.patch
Type: text/x-patch
Part: 1
Message: Re: Document NULL
From 7a68f303429e05f62f7ec1831ca8d75972e9da6f Mon Sep 17 00:00:00 2001
From: "David G. Johnston" <David.G.Johnston@Gmail.com>
Date: Mon, 15 Dec 2025 15:01:22 -0700
Subject: [PATCH 2/2] v9-edit

---
 doc/src/sgml/func/func-comparisons.sgml | 31 ++++++------
 doc/src/sgml/func/func-subquery.sgml    | 66 ++++++++++++-------------
 doc/src/sgml/nullvalues.sgml            |  9 +++-
 3 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/doc/src/sgml/func/func-comparisons.sgml b/doc/src/sgml/func/func-comparisons.sgml
index 970997e368a..b574f8afc45 100644
--- a/doc/src/sgml/func/func-comparisons.sgml
+++ b/doc/src/sgml/func/func-comparisons.sgml
@@ -75,9 +75,9 @@
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence null values since the multiple equality
-   tests are OR'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of null values since the
+   multiple equality tests are OR'd together.
   </para>
   </sect2>
 
@@ -95,9 +95,9 @@
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of null values since the multiple inequality
-   tests are OR'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of null values since the
+   multiple inequality tests are AND'd together.
   </para>
 
   </sect2>
@@ -123,10 +123,10 @@
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence of both elements and null values since the multiple equality
-   tests are AND'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of both elements and null
+   values since the multiple equality tests are OR'd together.
   </para>
 
   <para>
@@ -156,10 +156,10 @@
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of both elements and null values since the multiple equality
-   tests are AND'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of both elements and null
+   values since the multiple equality tests are AND'd together.
   </para>
 
   <para>
@@ -259,8 +259,7 @@
    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
+   Composite type comparisons are allowed when the <replaceable>operator</replaceable> is
    <literal>=</literal>,
    <literal>&lt;&gt;</literal>,
    <literal>&lt;</literal>,
diff --git a/doc/src/sgml/func/func-subquery.sgml b/doc/src/sgml/func/func-subquery.sgml
index d516dc7132d..5d4421b5355 100644
--- a/doc/src/sgml/func/func-subquery.sgml
+++ b/doc/src/sgml/func/func-subquery.sgml
@@ -104,9 +104,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence of both rows and null values since the multiple equality
-   tests are AND'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of both rows and null
+   values since the multiple equality tests are OR'd together.
   </para>
 
   <para>
@@ -132,9 +132,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence of both rows and null values since the multiple equality
-   tests are OR'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of both rows and null
+   values since the multiple equality tests are OR'd together.
   </para>
   </sect2>
 
@@ -154,9 +154,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of both rows and null values since the multiple inequality
-   tests are OR'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of both rows and null
+   values since the multiple inequality tests are AND'd together.
   </para>
 
   <para>
@@ -182,9 +182,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of both rows and null values since the multiple inequality
-   tests are OR'd together.
+   As explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of both rows and null
+   values since the multiple inequality tests are AND'd together.
   </para>
   </sect2>
 
@@ -213,10 +213,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence of both rows and null values since the multiple equality
-   tests are AND'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of both rows and null
+   values since the multiple equality tests are OR'd together.
   </para>
 
   <para>
@@ -243,10 +243,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>false</quote> result in the presence of both rows and null values since the multiple equality
-   tests are OR'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>false</quote> result in the presence of both rows and null
+   values since the multiple equality tests are AND'd together.
   </para>
 
   <para>
@@ -274,10 +274,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of both rows and null values since the multiple equality
-   tests are AND'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of both rows and null
+   values since the multiple equality tests are AND'd together.
   </para>
 
   <para>
@@ -307,10 +307,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, it is not possible to see
-   a <quote>true</quote> result in the presence of both rows and null values since the multiple equality
-   tests are AND'd together.  Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, it is not possible
+   to see a <quote>true</quote> result in the presence of both rows and null
+   values since the multiple equality tests are AND'd together.
   </para>
 
   </sect2>
@@ -338,11 +338,11 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2);
   </para>
 
   <para>
-   If <replaceable>operator</replaceable> can produce null valued booleans then, as explained in
-   <xref linkend="nullvalues-multielement"/>, the result cannot be <quote>true</quote> in the
-   presence of null valued fields in either the row constructor or the subquery result row, as
-   the individual field tests are AND'd together.
-   Note that <literal>IS DISTINCT FROM</literal> is not an operator.
+   If <replaceable>operator</replaceable> can produce null valued booleans then,
+   as explained in <xref linkend="nullvalues-multielement"/>, the result cannot
+   be <quote>true</quote> in the presence of null valued fields in either the
+   row constructor or the subquery result row, as the individual field tests
+   are AND'd together.
   </para>
 
   <para>
diff --git a/doc/src/sgml/nullvalues.sgml b/doc/src/sgml/nullvalues.sgml
index 53063f598ee..c5a0abec23e 100644
--- a/doc/src/sgml/nullvalues.sgml
+++ b/doc/src/sgml/nullvalues.sgml
@@ -44,6 +44,11 @@ VALUES (1, 1), (2, NULL), (3, 4);
 
 -- This makes null values print as \N in the output instead of the empty string.
 \pset null '\\N'
+
+-- These cause boolean values to print as true/false instead of t/f.
+\pset display_true true
+\pset display_false false
+
 -- Removes the row count footer that prints by default.
 \pset footer off
 </programlisting>
@@ -270,7 +275,7 @@ SELECT
    Because of this SQL standard rule, checking for a null value has an
    explicit <literal>IS NULL</literal> predicate.  Additionally, there are comparison
    predicates that consider a null value equal to other null values but unequal
-   to any other value (e.g., <literal>IS DISTINCT</literal>, and <literal>IS TRUE</literal>.)
+   to any other value (e.g., <literal>IS DISTINCT FROM</literal>, and <literal>IS TRUE</literal>.)
    These, and other predicates, are described in
    <xref linkend="functions-comparison-pred-table"/>
 <programlisting>
@@ -668,7 +673,7 @@ SELECT
    <title>Row-wise Composite Involved Comparisons</title>
    <para>
     In these three situations, null values are considered equal to each other and greater than
-    all non-null valueS.
+    all non-null values.
    </para>
 <programlisting>
 SELECT s, t,
-- 
2.34.1