From 662d684d0eddffb381369e909d8c70bd723025ac Mon Sep 17 00:00:00 2001 From: Luca Dametto Date: Sun, 15 Dec 2024 18:33:13 +0100 Subject: [PATCH] Improved documentation for Syntax, s. Operators Precedence --- doc/src/sgml/syntax.sgml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index 916189a7d6..79f3b9ce5f 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1111,7 +1111,7 @@ CAST ( 'string' AS type ) < > = <= >= <> - comparison operators + comparison operators * @@ -1151,6 +1151,16 @@ CAST ( 'string' AS type ) matter what yours does. + + * Note that PostgreSQL follows SQL's 3VL, + due to that some comparisons regarding NULL values may not work as + you might expect. + As an example, two nullable columns that contain NULL, when compared using + the OPERATOR =, will return nothing + instead of TRUE like your programming language may do. + In this case, only 'IS NOT DISTINCT FROM' would return the result you expect. + + When a schema-qualified operator name is used in the OPERATOR syntax, as for example in: -- 2.39.5 (Apple Git-154)