]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: further wordsmith around IS/DISTINCT 940/head
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 30 Oct 2024 14:44:29 +0000 (15:44 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 30 Oct 2024 14:48:58 +0000 (15:48 +0100)
Also restore lost link reference.

docs/basic/from_pg2.rst

index ef78bb381277a8f3011e655f8b698140d98f3773..7fb94d92f540631f8eb865b748019548edf477b9 100644 (file)
@@ -270,8 +270,8 @@ You cannot use :sql:`IS %s` or :sql:`IS NOT %s`::
     LINE 1: SELECT * FROM foo WHERE field IS $1
                                          ^
 
-This is probably caused by the fact that :sql:`IS` is not a binary operator in
-PostgreSQL; rather, :sql:`IS NULL` and :sql:`IS NOT NULL` are unary operators
+This is probably caused by the fact that :sql:`IS` is not a binary predicate in
+PostgreSQL; rather, :sql:`IS NULL` and :sql:`IS NOT NULL` are unary predicates
 and you cannot use :sql:`IS` with anything else on the right hand side.
 Testing in psql:
 
@@ -279,11 +279,12 @@ Testing in psql:
 
     =# SELECT 10 IS 10;
     ERROR:  syntax error at or near "10"
-    LINE 1: select 10 is 10;
+    LINE 1: SELECT 10 IS 10;
                          ^
 
-What you can do instead is to use :sql:`IS NOT DISTINCT FROM %s` in place of
-:sql:`IS %s` (please pay attention to the awkwardly reversed :sql:`NOT`)::
+What you can do is to use `IS [NOT] DISTINCT FROM`__ predicate instead:
+:sql:`IS NOT DISTINCT FROM %s` can be used in place of :sql:`IS %s` (please
+pay attention to the awkwardly reversed :sql:`NOT`)::
 
     >>> conn.execute("SELECT * FROM foo WHERE field IS NOT DISTINCT FROM %s", [None])