Received: from candle.pha.pa.us (pgman@nav-43.dsl.navpoint.com [162.33.245.46]) by hub.org (8.10.1/8.10.1) with ESMTP id e67IRWW93176 for ; Fri, 7 Jul 2000 14:27:33 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id OAA01965; Fri, 7 Jul 2000 14:24:19 -0400 (EDT) From: Bruce Momjian Message-Id: <200007071824.OAA01965@candle.pha.pa.us> Subject: Re: Search for underscore w/ LIKE In-Reply-To: <11200.962994098@sss.pgh.pa.us> "from Tom Lane at Jul 7, 2000 02:21:38 pm" To: Tom Lane Date: Fri, 7 Jul 2000 14:24:19 -0400 (EDT) CC: brianb-pgsql@edsamail.com, pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL77 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200007/83 > 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, Pennsylvania 19026