Doc: explain that LIKE et al can be used in ANY (sub-select) etc.
authorTom Lane
Mon, 23 Mar 2020 16:42:15 +0000 (12:42 -0400)
committerTom Lane
Mon, 23 Mar 2020 16:42:15 +0000 (12:42 -0400)
This wasn't stated anywhere, and it's perhaps not that obvious,
since we get questions about it from time to time.  Also undocumented
was that the parser actually translates these into operators.

Discussion: https://postgr.es/m/CAFj8pRBkvZ71BqGKZnBBG4=0cKG+s50Dy+DYmrizUKEpAtdc+w@mail.gmail.com

doc/src/sgml/func.sgml

index 0c45784b352236df48a9378c3b27468d1c942d23..9396d2847d5f602fde2275278d9b4fe9928980f2 100644 (file)
@@ -3962,7 +3962,23 @@ cast(-44 as bit(12))           111111010100
     !~~ and !~~* operators that
     represent NOT LIKE and NOT
     ILIKE, respectively.  All of these operators are
-    PostgreSQL-specific.
+    PostgreSQL-specific.  You may see these
+    operator names in EXPLAIN output and similar
+    places, since the parser actually translates LIKE
+    et al. to these operators.
+   
+
+   
+    The phrases LIKEILIKE,
+    NOT LIKE, and NOT ILIKE are
+    generally treated as operators
+    in PostgreSQL syntax; for example they can
+    be used in expression
+    operator ANY
+    (subquery) constructs, although
+    an ESCAPE clause cannot be included there.  In some
+    obscure cases it may be necessary to use the underlying operator names
+    instead.