Skip to content

Commit 64232da

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 036fdf6 commit 64232da

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
@@ -4159,7 +4159,23 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
41594159
<literal>!~~</literal> and <literal>!~~*</literal> operators that
41604160
represent <function>NOT LIKE</function> and <function>NOT
41614161
ILIKE</function>, respectively. All of these operators are
4162-
<productname>PostgreSQL</productname>-specific.
4162+
<productname>PostgreSQL</productname>-specific. You may see these
4163+
operator names in <command>EXPLAIN</command> output and similar
4164+
places, since the parser actually translates <function>LIKE</function>
4165+
et al. to these operators.
4166+
</para>
4167+
4168+
<para>
4169+
The phrases <function>LIKE</function>, <function>ILIKE</function>,
4170+
<function>NOT LIKE</function>, and <function>NOT ILIKE</function> are
4171+
generally treated as operators
4172+
in <productname>PostgreSQL</productname> syntax; for example they can
4173+
be used in <replaceable>expression</replaceable>
4174+
<replaceable>operator</replaceable> ANY
4175+
(<replaceable>subquery</replaceable>) constructs, although
4176+
an <literal>ESCAPE</literal> clause cannot be included there. In some
4177+
obscure cases it may be necessary to use the underlying operator names
4178+
instead.
41634179
</para>
41644180

41654181
<para>

0 commit comments

Comments
 (0)