Re: BUG #3438: Problem selecting backslash from a byte array - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3438: Problem selecting backslash from a byte array
Date
Msg-id 27384.1184173530@sss.pgh.pa.us
Whole thread Raw
In response to BUG #3438: Problem selecting backslash from a byte array  ("radoslav hodnicak" <rh@4096.sk>)
List pgsql-bugs
"radoslav hodnicak" <rh@4096.sk> writes:
> create table backslashtest (test bytea null);
> insert into backslashtest values (E'\\134'::bytea);
> select * from backslashtest where test like E'\\134'::bytea;

Backslash is a special character to LIKE.  Perhaps you would prefer
to specify another escape character, or none at all:

select * from backslashtest where test like E'\\134'::bytea escape '';

If you don't want any special pattern characters, why are you using
LIKE rather than plain = ?

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: BUG #3438: Problem selecting backslash from a byte array
Next
From: "ISHIDA Akio"
Date:
Subject: BUG #3439: pg_standby and path name with space