Re: Who do I make _ not a wildcard?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Roy Souther <roy(at)silicontao(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Who do I make _ not a wildcard?
Date: 2001-07-28 19:18:40
Message-ID: Pine.BSF.4.21.0107281214450.89249-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sat, 28 Jul 2001, Roy Souther wrote:

> In PG the _ is a wildcard that means any singal char. I need to do a search
> for the actual _ char and not get back thousands of wrong matches. Is there
> and escape char that I could use? This needs to work with PG 7.0.3 & 7.1.2.

\\_ should work for a literal escape.
At least on current sources you can do something like:
like 'blah!_%' escape '!'
where ! becomes the escape character for the string.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-07-29 03:15:23 Re: nullif BUG???
Previous Message Roy Souther 2001-07-28 18:12:51 Who do I make _ not a wildcard?