Re: Search for underscore w/ LIKE - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: Search for underscore w/ LIKE
Date
Msg-id 200007071824.OAA01965@candle.pha.pa.us
Whole thread Raw
In response to Re: Search for underscore w/ LIKE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
> I wrote:
> > Similarly, '\\%' would be the way to match a literal %.  You can
> > actually backslash-quote any single character this way in LIKE,
> > but % and _ are the only ones where it makes a difference.
> 
> Er, check that.  Backslash itself also needs quoting in LIKE.
> 
> Exercise for the student: if you need to match a literal backslash
> in a LIKE pattern, how many backslashes do you have to write in your
> query?

I will fix the book.  Seems I didn't do the test properly.


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


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Search for underscore w/ LIKE
Next
From: Web Manager
Date:
Subject: Re: order by accents?