From 7a68f303429e05f62f7ec1831ca8d75972e9da6f Mon Sep 17 00:00:00 2001 From: "David G. Johnston" 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 @@ - As explained in , it is not possible to see - a false result in the presence null values since the multiple equality - tests are OR'd together. + As explained in , it is not possible + to see a false result in the presence of null values since the + multiple equality tests are OR'd together. @@ -95,9 +95,9 @@ - As explained in , it is not possible to see - a true result in the presence of null values since the multiple inequality - tests are OR'd together. + As explained in , it is not possible + to see a true result in the presence of null values since the + multiple inequality tests are AND'd together. @@ -123,10 +123,10 @@ - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a false result in the presence of both elements and null values since the multiple equality - tests are AND'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a false result in the presence of both elements and null + values since the multiple equality tests are OR'd together. @@ -156,10 +156,10 @@ - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a true result in the presence of both elements and null values since the multiple equality - tests are AND'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a true result in the presence of both elements and null + values since the multiple equality tests are AND'd together. @@ -259,8 +259,7 @@ As discussed and shown in , 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 operator is + Composite type comparisons are allowed when the operator is =, <>, <, 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); - As explained in , it is not possible to see - a false result in the presence of both rows and null values since the multiple equality - tests are AND'd together. + As explained in , it is not possible + to see a false result in the presence of both rows and null + values since the multiple equality tests are OR'd together. @@ -132,9 +132,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - As explained in , it is not possible to see - a false result in the presence of both rows and null values since the multiple equality - tests are OR'd together. + As explained in , it is not possible + to see a false result in the presence of both rows and null + values since the multiple equality tests are OR'd together. @@ -154,9 +154,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - As explained in , it is not possible to see - a true result in the presence of both rows and null values since the multiple inequality - tests are OR'd together. + As explained in , it is not possible + to see a true result in the presence of both rows and null + values since the multiple inequality tests are AND'd together. @@ -182,9 +182,9 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - As explained in , it is not possible to see - a true result in the presence of both rows and null values since the multiple inequality - tests are OR'd together. + As explained in , it is not possible + to see a true result in the presence of both rows and null + values since the multiple inequality tests are AND'd together. @@ -213,10 +213,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a false result in the presence of both rows and null values since the multiple equality - tests are AND'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a false result in the presence of both rows and null + values since the multiple equality tests are OR'd together. @@ -243,10 +243,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a false result in the presence of both rows and null values since the multiple equality - tests are OR'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a false result in the presence of both rows and null + values since the multiple equality tests are AND'd together. @@ -274,10 +274,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a true result in the presence of both rows and null values since the multiple equality - tests are AND'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a true result in the presence of both rows and null + values since the multiple equality tests are AND'd together. @@ -307,10 +307,10 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - If operator can produce null valued booleans then, as explained in - , it is not possible to see - a true result in the presence of both rows and null values since the multiple equality - tests are AND'd together. Note that IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , it is not possible + to see a true result in the presence of both rows and null + values since the multiple equality tests are AND'd together. @@ -338,11 +338,11 @@ WHERE EXISTS (SELECT 1 FROM tab2 WHERE col2 = tab1.col2); - If operator can produce null valued booleans then, as explained in - , the result cannot be true 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 IS DISTINCT FROM is not an operator. + If operator can produce null valued booleans then, + as explained in , the result cannot + be true 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. 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 @@ -270,7 +275,7 @@ SELECT Because of this SQL standard rule, checking for a null value has an explicit IS NULL predicate. Additionally, there are comparison predicates that consider a null value equal to other null values but unequal - to any other value (e.g., IS DISTINCT, and IS TRUE.) + to any other value (e.g., IS DISTINCT FROM, and IS TRUE.) These, and other predicates, are described in @@ -668,7 +673,7 @@ SELECT Row-wise Composite Involved Comparisons In these three situations, null values are considered equal to each other and greater than - all non-null valueS. + all non-null values. SELECT s, t, -- 2.34.1