Re: Who do I make _ not a wildcard?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Roy Souther <roy(at)silicontao(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Who do I make _ not a wildcard?
Date: 2001-07-30 03:38:22
Message-ID: 200107300338.f6U3cMr25435@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


I also think two underscores make a literal underscore. Same with %.

> 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.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gonzo Rock 2001-07-30 04:19:11 Date Time Functions - ANSI SQL ?
Previous Message Tom Lane 2001-07-29 20:02:32 Re: Re: Restriction by grouping problem.