Skip to content

Commit deab495

Browse files
committed
Mention that LIKE ... ESCAPE '' is allowed to specify no
escape character.
1 parent 98e05ce commit deab495

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

doc/src/sgml/func.sgml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.79 2001/11/17 22:20:33 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.80 2001/11/18 21:17:10 tgl Exp $
33
Postgres documentation
44
-->
55

@@ -1228,8 +1228,19 @@ Postgres documentation
12281228
<para>
12291229
Note that the backslash already has a special meaning in string
12301230
literals, so to write a pattern constant that contains a backslash
1231-
you must write two backslashes in the query. You can avoid this by
1232-
selecting a different escape character with <literal>ESCAPE</literal>.
1231+
you must write two backslashes in the query. Thus, writing a pattern
1232+
that actually matches a literal backslash means writing four backslashes
1233+
in the query. You can avoid this by selecting a different escape
1234+
character with <literal>ESCAPE</literal>; then backslash isn't special
1235+
to <function>LIKE</> anymore. (But it's still special to the string
1236+
literal parser, so you still need two of them.)
1237+
</para>
1238+
1239+
<para>
1240+
It's also possible to select no escape character by writing
1241+
<literal>ESCAPE ''</literal>. In this case there is no way to
1242+
turn off the special meaning of underscore and percent signs in
1243+
the pattern.
12331244
</para>
12341245

12351246
<para>
@@ -1245,7 +1256,7 @@ Postgres documentation
12451256
<function>ILIKE</function>. There are also
12461257
<literal>!~~</literal> and <literal>!~~*</literal> operators that
12471258
represent <function>NOT LIKE</function> and <function>NOT
1248-
ILIKE</function>. All of these are also
1259+
ILIKE</function>. All of these operators are
12491260
<productname>Postgres</productname>-specific.
12501261
</para>
12511262
</sect2>

0 commit comments

Comments
 (0)