Re: backslashes in queries containing LIKE

From: Mickael Faivre-Macon <faivrem(at)gmail(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: backslashes in queries containing LIKE
Date: 2005-01-26 16:46:25
Message-ID: f132f7e305012608463b3f6325@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Michael,

Thank you for your reply.

We had read the LIKE doc but obviously missing the fact that

"the backslash already has a special meaning in string
literals, so to write a pattern constant that contains a backslash you
must write two backslashes in an SQL statement. Thus, writing a
pattern that actually matches a literal backslash means writing four
backslashes in the statement. "

Mickael.

--

See the "Pattern Matching" section in the "Functions and Operators"
chapter of the documentation:

http://www.postgresql.org/docs/8.0/static/functions-matching.html

The documentation under "LIKE" discusses issues regarding the escape
character (the backslash by default).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-01-26 17:00:22 Re: Partitioning Postgresql
Previous Message Frank D. Engel, Jr. 2005-01-26 16:30:41 Re: Splitting queries across servers