escape character \ - Mailing list pgsql-hackers

From Jose' Soares Da Silva
Subject escape character \
Date
Msg-id Pine.LNX.3.96.980416110548.743A-100000@proxy.bazzanese.com
Whole thread Raw
In response to Agregates in update?  (Aleksey Dashevsky <postgres@luckynet.co.il>)
Responses Re: [HACKERS] escape character \
List pgsql-hackers
Seems there's a bug using ESCAPE character (\) on LIKE clause:

prova=> create table tmp ( a text);
CREATE
prova=> insert into tmp values('\\');
INSERT 178729 1
prova=> select * from tmp where a = '\\';
a
--
\\
(1 row)

prova=> select * from tmp where a like '%\\%';
a
-
(0 rows)

prova=> select * from tmp where a like '%\\\\%';
a
--
\\
(1 row)

-- how many \ do I have to use? 1, 2, 3, 4 or 5 ???

prova=> select * from tmp where a like '%\\\\\%';
a
--
\\
(1 row)
                                                  Jose'


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] HAVING clause and 6.3.2 release
Next
From: "Jose' Soares Da Silva"
Date:
Subject: DROP TABLE inside transactions