Re: inconsistent functionality with LIKE operator - Mailing list pgsql-sql

From Tom Lane
Subject Re: inconsistent functionality with LIKE operator
Date
Msg-id 22657.985884223@sss.pgh.pa.us
Whole thread Raw
In response to inconsistent functionality with LIKE operator  (Phuong Ma <pma@commandprompt.com>)
List pgsql-sql
Phuong Ma <pma@commandprompt.com> writes:
> I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE
> statement.  How would I find the value "a\bc"?  I tried using the
> backslash to escape it: LIKE 'a\\b%';

I think you need four backslashes.  The string-literal parser eats one
level of backslashes, but you need the pattern that arrives at LIKE
to look like "a\\b%".

BTW, "PostgreSQL version 7.1" does not exist yet.

            regards, tom lane

pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Calling Java from psql (was Re: requesting help)
Next
From: Tom Lane
Date:
Subject: Re: Calling Java from psql (was Re: requesting help)