Escape wildcard problems.

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Escape wildcard problems.
Date: 2008-10-24 15:12:38
Message-ID: 482E80323A35A54498B8B70FF2B87980039B9A3B4A@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I read in the docs (section 9.7.1) that the backslash... \ ... is the default escape char to use in "like" expressions. Yet when I try it, it doesn't seem to work the ay I expect. Here's an example...

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 \).

Please advise.

Thanks
-dave

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harald Fuchs 2008-10-24 15:35:06 Re: Query m:n-Combination
Previous Message Michelle Konzack 2008-10-24 15:11:06 Re: Annoying Reply-To