Skip site navigation (1) Skip section navigation (2)

Re: BUG #3438: Problem selecting backslash from a byte array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "radoslav hodnicak" <rh(at)4096(dot)sk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3438: Problem selecting backslash from a byte array
Date: 2007-07-11 17:05:30
Message-ID: 27384.1184173530@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"radoslav hodnicak" <rh(at)4096(dot)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

In response to

pgsql-bugs by date

Next:From: ISHIDA AkioDate: 2007-07-12 19:36:54
Subject: BUG #3439: pg_standby and path name with space
Previous:From: Pavel StehuleDate: 2007-07-11 16:28:47
Subject: Re: BUG #3438: Problem selecting backslash from a byte array

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group