Re: BUG #5535: Backslash in condition for LIKE statement is not seen - Mailing list pgsql-bugs

From Kevin Grittner
Subject Re: BUG #5535: Backslash in condition for LIKE statement is not seen
Date
Msg-id 4C2CB5A00200002500032F43@gw.wicourts.gov
Whole thread Raw
In response to BUG #5535: Backslash in condition for LIKE statement is not seen  ("Jeff Benjamin" <jeff@ivertex.com>)
Responses Re: BUG #5535: Backslash in condition for LIKE statement is not seen  (Jeff Benjamin <jeff@ivertex.com>)
List pgsql-bugs
"Jeff Benjamin" <jeff@ivertex.com> wrote:

> Seems one cannot use a backslash character in a LIKE condition.

By default that has special meaning as an escape character.

Try this:

select * from test where pattern like E'\\w%' escape '#';

or this:

select * from test where pattern like E'\\\\w%';

-Kevin

pgsql-bugs by date:

Previous
From: "Jeff Benjamin"
Date:
Subject: BUG #5535: Backslash in condition for LIKE statement is not seen
Next
From: Jeff Benjamin
Date:
Subject: Re: BUG #5535: Backslash in condition for LIKE statement is not seen