On Fri, Oct 24, 2008 at 08:12:38AM -0700, Gauthier, Dave wrote:
> select name from templates where name like '%\_cont\_%';
> 
>           name
> ----------------------------------
> cgidvcontrol
> x8idvcontrol
> etc....
> 
> I would expect to NOT see these because the "cont" is not preceded by
> and followed by an underscore (because I escaped them with \).

You need to escape the escape! backslash is the escape character in
literals as well as like patterns, so you need to double it up.  I think
you want to be doing:

  name LIKE '%\\_cont\\_%'



  Sam

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to