Re: BUG #5535: Backslash in condition for LIKE statement is not seen

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jeff Benjamin" <jeff(at)ivertex(dot)com>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5535: Backslash in condition for LIKE statement is not seen
Date: 2010-07-01 20:34:56
Message-ID: 4C2CB5A00200002500032F43@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Jeff Benjamin" <jeff(at)ivertex(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Benjamin 2010-07-01 20:39:13 Re: BUG #5535: Backslash in condition for LIKE statement is not seen
Previous Message Jeff Benjamin 2010-07-01 20:26:38 BUG #5535: Backslash in condition for LIKE statement is not seen