From 868659775c49acbd3e6d2108e211ec046390d472 Mon Sep 17 00:00:00 2001
From: "David G. Johnston" <David.G.Johnston@Gmail.com>
Date: Thu, 29 Jan 2026 16:11:47 -0700
Subject: [PATCH v11 2/2] Update all examples


diff --git a/doc/src/sgml/nullvalues.sgml b/doc/src/sgml/nullvalues.sgml
index 9d226b59bb6..48635fc0d2c 100644
--- a/doc/src/sgml/nullvalues.sgml
+++ b/doc/src/sgml/nullvalues.sgml
@@ -1,5 +1,41 @@
 <!-- doc/src/sgml/nullvalues.sgml -->
+<!-- Agent Instructions for Interactive Example Review
+  - There are around 36 screen elements in this files.
+  - Show me each one along with its corresponding programlisting.
+  - Keep track of progress to avoid repeating or missing.
+  - When given new directives, update this block to remember them.
+  - Before presenting each example consult this block for how to behave.
+  - Also, using the psql program, run the programlisting
+  (you will need to incorporate the contents of the first program listing -
+  which has no screen output associated with it) to get them to execute correctly.
+  - Show also the result of running psql.
+  - Point out if the script run and the screen contents do not match.
+  - Wait for me to say 'next' before proceeding to the next pair.
+  - Do not point out trailing whitespace differences; psql produces such output.
+  - Do not tell me you are 'ignoring trailing whitespace as instructruced' or similar.
+  - IMPORTANT: Point out when screen elements have extra blank lines within table output that don't match psql output. These should be removed to match psql exactly.
+  - IMPORTANT: BEFORE running each example, check the programlisting for lowercase 'null' used as SQL NULL literals - these must be uppercase NULL (e.g., 'NULL::text' not 'null::text', 'array[1, NULL]' not 'array[1, null]'). Point out and fix these IMMEDIATELY.
+  - programlisting usage of literal NULL is uppercase.
+  - IMPORTANT: In programlisting elements, null literals should be written as uppercase NULL (e.g., 'NULL', 'null::text' should be 'NULL::text', 'array[1, NULL]' not 'array[1, null]'). Point out when programlistings use lowercase 'null' - this is incorrect.
+  - IMPORTANT: Column headers in screen elements should use titlecase (e.g., 'Is Null' not 'IS NULL', 'Count Value' not 'Count VALUE'). Point out when headers are not titlecase.
+  - IMPORTANT: Exception to titlecase rule - when the header refers to the SQL operator/predicate used in that column's expression, use the exact operator syntax (e.g., 'IS NULL', 'IS DISTINCT FROM', 'IS !=').
+  - IMPORTANT: SQL keywords AND/OR/IN should be uppercase in programlisting expressions but titlecase in column headers (e.g., 'True And Null' not 'True AND Null', 'In Present' not 'IN Present').
+  - IMPORTANT: Exception to titlecase rule - when referring to JSON null values use lowercase 'null' (e.g., 'Cast jsonb null to SQL NULL' not 'Cast jsonb NULL to SQL NULL'), and when referring to SQL NULL values use uppercase 'NULL'.
+  - Point out if headers exceed 80 characters.
+  - NEVER manually replace parts of screen elements, always copy in psql output.
+  - After making a program change re-run the entire example flow again.
+  - If there is a mis-match in the screen/psql output accept either 'fix' or 'skip' as commands, 'next' is invalid and ask whether to fix or skip.
+Example shell:
+cd psql << 'EOF'
+\pset null Null
+\pset display_true true
+\pset display_false false
+\pset footer off
 
+SELECT
+ NULL OR NOT NULL AS "N OR !N";
+EOF
+-->
 <sect1 id="nullvalues">
  <title>Null Values Overview</title>
 
@@ -97,9 +133,9 @@ VALUES (1, 1), (2, NULL), (3, 4);
 <programlisting>
 SELECT
  NULL AS "Literal Null Value",
- pg_typeof(null) AS "Type of Null",
+ pg_typeof(NULL) AS "Type of Null",
  pg_typeof(NULL::text) AS "Type of Cast Null",
- cast(null as text) AS "Cast Null Value";
+ cast(NULL as text) AS "Cast Null Value";
 </programlisting>
 <screen>
  Literal Null Value | Type of Null | Type of Cast Null | Cast Null Value
@@ -113,7 +149,8 @@ SELECT text NULL;
 </programlisting>
 <screen>
 ERROR:  column "text" does not exist
-LINE 1: select text NUll;
+LINE 1: SELECT text NULL;
+               ^
 </screen>
    </para>
    <para>
@@ -163,7 +200,7 @@ ON countries.country = flagships.country;
    country   | flagship
 -------------+----------
  Spain       | Ship
- Switzerland |null
+ Switzerland | Null
 </screen>
    </para>
   </sect3>
@@ -216,11 +253,11 @@ ON countries.country = flagships.country;
     that "p OR NOT p" is always true.
 <programlisting>
 SELECT
- NULL OR NOT NULL AS "N OR !N";
+ NULL OR NOT NULL AS "Null Or Not Null";
 </programlisting>
 <screen>
- N OR !N
----------
+ Null Or Not Null
+------------------
  Null
 </screen>
     (See <xref linkend="nullvalues-operands"/> for more explanation.)
@@ -246,24 +283,24 @@ SELECT
    to any value, including other null values.
 <programlisting>
 SELECT
- NULL = NULL AS "N = N",
- NULL != NULL AS "N != N",
- 1 = NULL AS "1 = N",
- 1 != NULL AS "1 != N",
+ NULL = NULL AS "Null = Null",
+ NULL != NULL AS "Null != Null",
+ 1 = NULL AS "1 = Null",
+ 1 != NULL AS "1 != Null",
  1 = 1 AS "1 = 1",
  1 != 1 AS "1 != 1";
 </programlisting>
 <screen>
- N = N | N != N | 1 = N | 1 != N | 1 = 1 | 1 != 1
--------+--------+-------+--------+-------+--------
- Null  | Null   | Null  | Null   | true  | false
+ Null = Null | Null != Null | 1 = Null | 1 != Null | 1 = 1 | 1 != 1
+-------------+--------------+----------+-----------+-------+--------
+ Null        | Null         | Null     | Null      | true  | false
 </screen>
    However, as with many rules, there are exceptions, as noted in
    <xref linkend="nullvalues-multielementcomparison"/>.
    Particularly, when the two compared values are part of a larger multi-element value.
 <programlisting>
 SELECT
- array[1,2]=array[1,null] AS "Array Equals";
+ array[1,2]=array[1,NULL] AS "Array Equals";
 </programlisting>
 <screen>
  Array Equals
@@ -281,16 +318,16 @@ SELECT
 <programlisting>
 SELECT id, value,
  value IS NULL AS "IS NULL",
- value IS DISTINCT FROM id AS "IS DIST",
+ value IS DISTINCT FROM id AS "IS DISTINCT",
  value != id AS "IS !="
 FROM null_examples;
 </programlisting>
 <screen>
- id | value | IS NULL | IS DIST | IS !=
-----+-------+---------+---------+-------
-  1 |     1 | false   | false   | false
-  2 |  null | true    | true    | Null
-  3 |     4 | false   | true    | true
+ id | value | IS NULL | IS DISTINCT | IS !=
+----+-------+---------+-------------+-------
+  1 |     1 | false   | false       | false
+  2 |  Null | true    | true        | Null
+  3 |     4 | false   | true        | true
 </screen>
   </para>
   <para>
@@ -313,19 +350,29 @@ FROM null_examples;
 <programlisting>
 SELECT
  c,
- c IS NULL AS "c IS N",
- NOT(c IS NULL) AS "NOT c IS N",
- c IS NOT NULL AS "c IS NOT N",
- ROW(value, value) IS NULL AS "ROW(v,v) IS N",
- ROW(value, value) IS NOT NULL AS "ROW(v,v) IS NOT N"
+ c IS NULL AS "c IS NULL",
+ NOT(c IS NULL) AS "NOT c IS NULL",
+ c IS NOT NULL AS "c IS NOT NULL"
 FROM null_examples AS c;
+SELECT
+ value,
+ ROW(value, value) IS NULL AS "ROW(v,v) IS NULL",
+ NOT(ROW(value, value) IS NULL) AS "NOT ROW(v,v) IS NULL",
+ ROW(value, value) IS NOT NULL AS "ROW(v,v) IS NOT NULL"
+FROM null_examples;
 </programlisting>
 <screen>
-   c   | c IS N | NOT c IS N | c IS NOT N | ROW(v,v) IS N | ROW(v,v) IS NOT N
--------+--------+------------+------------+---------------+-------------------
- (1,1) | false  | true       | true       | false         | true
- (2,)  | false  | true       | false      | true          | false
- (3,4) | false  | true       | true       | false         | true
+   c   | c IS NULL | NOT c IS NULL | c IS NOT NULL
+-------+-----------+---------------+---------------
+ (1,1) | false     | true          | true
+ (2,)  | false     | true          | false
+ (3,4) | false     | true          | true
+
+ value | ROW(v,v) IS NULL | NOT ROW(v,v) IS NULL | ROW(v,v) IS NOT NULL
+-------+------------------+----------------------+----------------------
+     1 | false            | true                 | true
+  Null | true             | false                | false
+     4 | false            | true                 | true
 </screen>
    See <xref linkend="nullvalues-multielement"/> below for an explanation.
   </para>
@@ -338,8 +385,8 @@ FROM null_examples AS c;
    is a null value will result in a null-valued output.
 <programlisting>
 SELECT
- 1 + null AS "Add",
- 'text' || null AS "Concatenate";
+ 1 + NULL AS "Add",
+ 'text' || NULL AS "Concatenate";
 </programlisting>
 <screen>
  Add  | Concatenate
@@ -353,15 +400,15 @@ SELECT
    uses equality, not distinctness, for testing.
 <programlisting>
 SELECT
- 1 IN (1, null) AS "In Present",
- 1 IN (2, null) AS "In Missing",
- null IN (1, 2) AS "N In Non-N",
- null IN (null, 2) AS "N In N";
+ 1 IN (1, NULL) AS "In Present",
+ 1 IN (2, NULL) AS "In Missing",
+ NULL IN (1, 2) AS "Null In Non-Null",
+ NULL IN (NULL, 2) AS "Null In Null";
 </programlisting>
 <screen>
- In Present | In Missing | N In Non-N | N In N
-------------+------------+------------+--------
- true       | Null       | Null       | Null
+ In Present | In Missing | Null In Non-Null | Null In Null
+------------+------------+------------------+--------------
+ true       | Null       | Null             | Null
 </screen>
    This is just an extension of the multi-element testing behavior described in
    <xref linkend="nullvalues-multielement"/>.
@@ -386,7 +433,7 @@ FROM null_examples;
  id | value |  Affirm   |  Negate   | Safe Affirm | Safe Negate
 ----+-------+-----------+-----------+-------------+-------------
   1 |     1 | Equal     | Equal     | Equal       | Equal
-  2 |  null | Not Equal | Equal     | Null        | Null
+  2 |  Null | Not Equal | Equal     | Null        | Null
   3 |     4 | Not Equal | Not Equal | Not Equal   | Not Equal
 </screen>
   </para>
@@ -396,15 +443,15 @@ FROM null_examples;
    determine the outcome.
 <programlisting>
 SELECT
- true OR null AS "T or N",
- false OR null AS "F or N",
- true AND null AS "T and N",
- false AND null AS "F and N";
+ true OR NULL AS "True Or Null",
+ false OR NULL AS "False Or Null",
+ true AND NULL AS "True And Null",
+ false AND NULL AS "False And Null";
 </programlisting>
 <screen>
- T or N | F or N | T and N | F and N
---------+--------+---------+---------
- true   | Null   | Null    | false
+ True Or Null | False Or Null | True And Null | False And Null 
+--------------+---------------+---------------+----------------
+ true         | Null          | Null          | false
 </screen>
   </para>
  </sect2>
@@ -434,8 +481,8 @@ INSERT 0 2
  id | value | de_id | de_value |   pg_typeof
 ----+-------+-------+----------+----------------
   1 |     1 |     1 |        1 | domain_example
-  2 |  null |     2 |        2 | domain_example
-  3 |     4 |  null |     null | domain_example
+  2 |  Null |     2 |        2 | domain_example
+  3 |     4 |  Null |     Null | domain_example
 
 ROLLBACK
 </screen>
@@ -550,24 +597,24 @@ SELECT
    <para>
 <programlisting>
 SELECT
- 1 = ANY(array[1, 1, NULL]) AS "Any-Null-Match",
- 1 = ANY(array[1, 1]) AS "Any-NoNull-Match",
- 1 = ALL(array[1, 1, NULL]) AS "ALL-Null-Match",
- 1 = ALL(array[1, 1]) AS "All-NoNull-Match";
+ 1 = ANY(array[1, 1, NULL]) AS "Any-HasNulls-Hit",
+ 1 = ANY(array[1, 1]) AS "Any-NoNulls-Hit",
+ 1 = ALL(array[1, 1, NULL]) AS "All-HasNulls-Hit",
+ 1 = ALL(array[1, 1]) AS "All-NoNulls-Hit";
 SELECT
- 2 IN (1, 1, NULL) AS "IN-Null-Negative",
- 2 IN (1, 1) AS "IN-NoNull-Negative",
- 2 NOT IN (2, 2, NULL) AS "NotIN-Null-Negative",
- 2 NOT IN (2, 2) AS "NotIN-NoNull-Negative";
+ 2 IN (1, 1, NULL) AS "In-HasNulls-Miss",
+ 2 IN (1, 1) AS "In-NoNulls-Miss",
+ 2 NOT IN (2, 2, NULL) AS "NotIn-HasNulls-Miss",
+ 2 NOT IN (2, 2) AS "NotIn-NoNulls-Miss";
 </programlisting>
 <screen>
- Any-Null-Match | Any-NoNull-Match | ALL-Null-Match | All-NoNull-Match
-----------------+------------------+----------------+------------------
- true           | true             | Null           | true
+ Any-HasNulls-Hit | Any-NoNulls-Hit | All-HasNulls-Hit | All-NoNulls-Hit
+------------------+-----------------+------------------+-----------------
+ true             | true            | Null             | true
 
- IN-Null-Negative | IN-NoNull-Negative | NotIN-Null-Negative | NotIN-NoNull-Negative
-------------------+--------------------+---------------------+-----------------------
- Null             | false              | false               | false
+ In-HasNulls-Miss | In-NoNulls-Miss | NotIn-HasNulls-Miss | NotIn-NoNulls-Miss
+------------------+-----------------+---------------------+--------------------
+ Null             | false           | false               | false
 </screen>
    </para>
   </sect3>
@@ -585,24 +632,24 @@ SELECT
    <para>
 <programlisting>
 SELECT
- 1 = ANY(SELECT unnest(array[1, 1, NULL])) AS "Any-Null-Match",
- 1 = ANY(SELECT unnest(array[1, 1])) AS "Any-NoNull-Match",
- 1 = ALL(SELECT unnest(array[1, 1, NULL])) AS "ALL-Null-Match",
- 1 = ALL(SELECT unnest(array[1, 1])) AS "All-NoNull-Match";
+ 1 = ANY(SELECT unnest(array[1, 1, NULL])) AS "Any-HasNulls-Hit",
+ 1 = ANY(SELECT unnest(array[1, 1])) AS "Any-NoNulls-Hit",
+ 1 = ALL(SELECT unnest(array[1, 1, NULL])) AS "All-HasNulls-Hit",
+ 1 = ALL(SELECT unnest(array[1, 1])) AS "All-NoNulls-Hit";
 SELECT
- 2 = ANY(SELECT unnest(array[1, 1, NULL])) AS "Any-Null-NoMatch",
- 2 = ANY(SELECT unnest(array[1, 1])) AS "Any-NoNull-NoMatch",
- 2 = ALL(SELECT unnest(array[1, 1, NULL])) AS "ALL-Null-NoMatch",
- 2 = ALL(SELECT unnest(array[1, 1])) AS "All-NoNull-NoMatch";
+ 2 = ANY(SELECT unnest(array[1, 1, NULL])) AS "Any-HasNulls-Miss",
+ 2 = ANY(SELECT unnest(array[1, 1])) AS "Any-NoNulls-Miss",
+ 2 = ALL(SELECT unnest(array[1, 1, NULL])) AS "All-HasNulls-Miss",
+ 2 = ALL(SELECT unnest(array[1, 1])) AS "All-NoNulls-Miss";
 </programlisting>
 <screen>
- Any-Null-Match | Any-NoNull-Match | ALL-Null-Match | All-NoNull-Match
-----------------+------------------+----------------+------------------
- true           | true             | Null           | true
+ Any-HasNulls-Hit | Any-NoNulls-Hit | All-HasNulls-Hit | All-NoNulls-Hit
+------------------+-----------------+------------------+-----------------
+ true             | true            | Null             | true
 
- Any-Null-NoMatch | Any-NoNull-NoMatch | ALL-Null-NoMatch | All-NoNull-NoMatch
-------------------+--------------------+------------------+--------------------
- Null             | false              | false            | false
+ Any-HasNulls-Miss | Any-NoNulls-Miss | All-HasNulls-Miss | All-NoNulls-Miss
+-------------------+------------------+-------------------+------------------
+ Null              | false            | false             | false
 </screen>
    </para>
   </sect3>
@@ -638,13 +685,13 @@ SELECT
     <link linkend="sql-syntax-array-constructors">array constructors</link> or array-typed values.
 <programlisting>
 SELECT
- array[1,2]=array[1,null] AS "Constructors",
+ array[1,2]=array[1,NULL] AS "Constructors",
  s, t,
  s = t AS "Stored Equality",
  t &gt; s AS "Stored Ordering"
 FROM
 (values (array[1,2])) AS sv (s),
-(values (array[1,null::integer])) AS st (t);
+(values (array[1,NULL::integer])) AS st (t);
 </programlisting>
 <screen>
  Constructors |   s   |    t     | Stored Equality | Stored Ordering
@@ -659,8 +706,8 @@ FROM
     In this situation, null values produce unknown when compared to all values.
 <programlisting>
 SELECT
- (1,2)=(1,null) AS "NonNull=Null",
- (1,null::integer)=(1,null) AS "Null=Null";
+ (1,2)=(1,NULL) AS "NonNull=Null",
+ (1,NULL::integer)=(1,NULL) AS "Null=Null";
 </programlisting>
 <screen>
  NonNull=Null | Null=Null
@@ -677,17 +724,17 @@ SELECT
    </para>
 <programlisting>
 SELECT s, t,
- s = t AS "Stored Equals Stored",
- t &lt; (1,2) AS "Stored LT Constructor",
- t = (1,null::integer) AS "Stored Equals Constructor"
+ s = t AS "Stored = Stored",
+ t &lt; (1,2) AS "Stored &lt; Constructor",
+ t = (1,NULL::integer) AS "Stored = Constructor"
 FROM
  (values (1,2)) AS s,
- (values (1,null::integer)) AS t;
+ (values (1,NULL::integer)) AS t;
 </programlisting>
 <screen>
-   s   |  t   | Stored Equals Stored | Stored LT Constructor | Stored Equals Constructor
--------+------+----------------------+-----------------------+---------------------------
- (1,2) | (1,) | false                | false                 | true
+   s   |  t   | Stored = Stored | Stored < Constructor | Stored = Constructor 
+-------+------+-----------------+----------------------+----------------------
+ (1,2) | (1,) | false           | false                | true
 </screen>
   </sect3>
   <sect3 id="nullvalues-multielementcomparison-sqlconformance">
@@ -721,16 +768,16 @@ FROM
    like for concatenating text, but not always, like concatenating an element onto an array.
 <programlisting>
 SELECT
- lower(null::text) AS "Lower",
- left('text', null) AS "Left",
- 'one' || null AS "|| Text Op",
- concat('one', null) AS "concat Text Func",
- array_append(array[1], null) AS "append([], null)",
- array[1]::integer[] || null::integer AS "[] || null",
- array[1]::integer[] || null::integer[] AS "[] || null[]";
+ lower(NULL::text) AS "Lower",
+ left('text', NULL) AS "Left",
+ 'one' || NULL AS "|| Text Op",
+ concat('one', NULL) AS "Concat Text Func",
+ array_append(array[1], NULL) AS "append([], NULL)",
+ array[1]::integer[] || NULL::integer AS "[] || NULL",
+ array[1]::integer[] || NULL::integer[] AS "[] || NULL[]";
 </programlisting>
 <screen>
- Lower | Left | || Text Op | concat Text Func | append([], null) | [] || null | [] || null[]
+ Lower | Left | || Text Op | Concat Text Func | append([], NULL) | [] || NULL | [] || NULL[]
 -------+------+------------+------------------+------------------+------------+--------------
  Null  | Null | Null       | one              | {1,NULL}         | {1,NULL}   | {1}
 </screen>
@@ -756,7 +803,7 @@ SELECT
  count(*) AS "Count",
  count(value) AS "Count Value",
  count(null_examples) AS "Count Composite",
- count(row(value, value)) AS "Count Row"
+ count(ROW(value, value)) AS "Count Row"
 FROM null_examples;
 </programlisting>
 <screen>
@@ -789,7 +836,7 @@ SELECT id, value AS "Not Equal to 1"
 FROM null_examples
 WHERE value != 1;
 
-SELECT id, value AS "IS NULL"
+SELECT id, value AS "Is Null"
 FROM null_examples
 WHERE value IS NULL;
 </programlisting>
@@ -802,9 +849,9 @@ WHERE value IS NULL;
 ----+----------------
   3 |              4
 
- id | IS NULL
+ id | Is Null
 ----+---------
-  2 |    null
+  2 |    Null
 </screen>
   </para>
  </sect2>
@@ -824,7 +871,9 @@ ALTER TABLE null_examples ADD CONSTRAINT value_not_1 CHECK (value != 1);
 ROLLBACK;
 </programlisting>
 <screen>
+BEGIN
 ERROR:  check constraint "value_not_1" of relation "null_examples" is violated by some row
+ROLLBACK
 </screen>
 <programlisting>
 BEGIN;
@@ -832,7 +881,9 @@ ALTER TABLE null_examples ADD CONSTRAINT value_not_10 CHECK (value != 10);
 ROLLBACK;
 </programlisting>
 <screen>
+BEGIN
 ALTER TABLE
+ROLLBACK
 </screen>
    We are using a transaction (<command>BEGIN</command> and <command>ROLLBACK</command>) and
    the <command>ALTER TABLE</command> command to add two constraints to our null_examples table.
@@ -939,9 +990,11 @@ INSERT INTO null_examples VALUES (4, NULL);
 ROLLBACK;
 </programlisting>
 <screen>
+BEGIN
 CREATE INDEX
 CREATE INDEX
 INSERT 0 1
+ROLLBACK
 </screen>
 <programlisting>
 BEGIN;
@@ -950,9 +1003,11 @@ INSERT INTO null_examples VALUES (4, NULL);
 ROLLBACK;
 </programlisting>
 <screen>
+BEGIN
 CREATE INDEX
 ERROR:  duplicate key value violates unique constraint "value_nulls_not_distinct_explicit"
 DETAIL:  Key (value)=(null) already exists.
+ROLLBACK
 </screen>
   </para>
   <para>
@@ -994,12 +1049,15 @@ DETAIL:  Key (value)=(null) already exists.
    instead return a null value.  This null value should not be considered the value of the setting
    but an error indicator.
 <programlisting>
+\echo /* false */
 SELECT current_setting('example.string', false);
+\echo
+\echo /* true */
 SELECT current_setting('example.string', true);
 </programlisting>
 <screen>
 /* false */
-unrecognized configuration parameter "example.string"
+ERROR:  unrecognized configuration parameter "example.string"
 
 /* true */
  current_setting
@@ -1019,12 +1077,18 @@ unrecognized configuration parameter "example.string"
 -- The transaction markers are left here to emphasize the rollback behavior.
 SHOW example.string;
 BEGIN;
+\echo
+\echo /* setting it to NULL */
 SELECT set_config('example.string', NULL, true);
 SELECT current_setting('example.string') IS NULL AS "Setting Is Null";
+\echo /* recognized as an empty string by current_setting */
+\echo
 ROLLBACK;
 SHOW example.string;
+\echo /* still recognized by show after rollback - empty string */
 RESET example.string;
 SHOW example.string;
+\echo /* still recognized by show after reset - empty string */
 </programlisting>
 <screen>
 ERROR:  unrecognized configuration parameter "example.string"
@@ -1033,21 +1097,24 @@ BEGIN
 /* setting it to NULL */
  set_config
 ------------
-
+ 
 
  Setting Is Null
 -----------------
  false
+
 /* recognized as an empty string by current_setting */
 
 ROLLBACK
  example.string
 ----------------
+ 
 
 /* still recognized by show after rollback - empty string */
 RESET
  example.string
 ----------------
+ 
 
 /* still recognized by show after reset - empty string */
 </screen>
@@ -1075,10 +1142,10 @@ RESET
    (Note, while in SQL the capitalization of NULL is unimportant -
    all-caps is just convention - JSON requires lowercase.)
 <programlisting>
-SELECT 'null'::json IS NULL AS "JSON null is NULL";
+SELECT 'null'::json IS NULL AS "JSON null IS NULL";
 </programlisting>
 <screen>
- JSON null is NULL
+ JSON null IS NULL
 -------------------
  false
 </screen>
@@ -1086,12 +1153,12 @@ SELECT 'null'::json IS NULL AS "JSON null is NULL";
    or construction from literals, require that a valid number or text value be supplied as an operand
    and so an SQL null value cannot be targeted by those operators and functions.
 <programlisting>
- SELECT to_json(null::text);
+SELECT to_json(NULL::text);
 </programlisting>
 <screen>
  to_json
 ---------
- null
+ Null
 </screen>
    That all said, the system will convert an SQL null value to a JSON null value when in a
    composite type context.
@@ -1120,10 +1187,10 @@ FROM jsonb_to_recordset('[{"value":1},{"value":null},{"value":4}]'::jsonb) AS jt
 </screen>
    Or when a simple scalar JSON null is cast to an SQL type.
 <programlisting>
-SELECT 'null'::jsonb::numeric IS NULL AS "Cast jsonb NULL to SQL NULL";
+SELECT 'null'::jsonb::numeric IS NULL AS "Cast jsonb null to SQL NULL";
 </programlisting>
 <screen>
- Cast jsonb NULL to SQL NULL
+ Cast jsonb null to SQL NULL
 -----------------------------
  true
 </screen>
-- 
2.43.0

