Skip to content

Commit a7500cc

Browse files
committed
Doc: explain that LIKE et al can be used in ANY (sub-select) etc.
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
1 parent ef7d6d7 commit a7500cc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

doc/src/sgml/func.sgml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3962,7 +3962,23 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
39623962
<literal>!~~</literal> and <literal>!~~*</literal> operators that
39633963
represent <function>NOT LIKE</function> and <function>NOT
39643964
ILIKE</function>, respectively. All of these operators are
3965-
<productname>PostgreSQL</productname>-specific.
3965+
<productname>PostgreSQL</productname>-specific. You may see these
3966+
operator names in <command>EXPLAIN</command> output and similar
3967+
places, since the parser actually translates <function>LIKE</function>
3968+
et al. to these operators.
3969+
</para>
3970+
3971+
<para>
3972+
The phrases <function>LIKE</function>, <function>ILIKE</function>,
3973+
<function>NOT LIKE</function>, and <function>NOT ILIKE</function> are
3974+
generally treated as operators
3975+
in <productname>PostgreSQL</productname> syntax; for example they can
3976+
be used in <replaceable>expression</replaceable>
3977+
<replaceable>operator</replaceable> ANY
3978+
(<replaceable>subquery</replaceable>) constructs, although
3979+
an <literal>ESCAPE</literal> clause cannot be included there. In some
3980+
obscure cases it may be necessary to use the underlying operator names
3981+
instead.
39663982
</para>
39673983
</sect2>
39683984

0 commit comments

Comments
 (0)