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'