Use the "ESCAPE" specifier
WHERE "name" ILIKE 'Nome ~% teste \\/' ESCAPE '~'
http://www.postgresql.org/docs/8.2/static/functions-matching.html
Note: you still need to have the \ twice for the string parser.
Without the ESCAPE you would need to do
WHERE "name" ILIKE 'Nome \% test \\\\/'
( 4 \ 's to represent one literal \ )
Thanks, but I still have the original issue with the slash. Searching with
WHERE "name" ILIKE 'Nome \% test \\\\/%'
don't give me a result, while
WHERE "name" ILIKE 'Nome \% test \\\\%'
(removed the slash, that is present in the row) works as expected. – Kknd
its possible your string does not have a literal "\/" like you specified. you possibly have a null, or other whitespace character inbetween. Or possibly, you have / in a different character set.
I would attempt to use this to test for that possible scenario
WHERE "name" ILIKE 'Nome \% ' AND "name" ~* '\\.{1,10}/'
which will return lines that have \/ separated by something( but not lines with no separation )