Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e67IM9W79304 for ; Fri, 7 Jul 2000 14:22:10 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA11203; Fri, 7 Jul 2000 14:21:39 -0400 (EDT) To: brianb-pgsql@edsamail.com, pgsql-sql@postgresql.org, Bruce Momjian Subject: Re: Search for underscore w/ LIKE In-reply-to: <10965.962991238@sss.pgh.pa.us> References: <20000707090925.3041.qmail@mail01.edsamail.com.ph> <10965.962991238@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 07 Jul 2000 13:33:58 -0400" Date: Fri, 07 Jul 2000 14:21:38 -0400 Message-ID: <11200.962994098@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200007/82 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? regards, tom lane