pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Her Goo <gu_he@msn.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: sql: "LIKE" problem
Date: Mon, 14 Mar 2005 02:32:12 -0500
Message-ID: <6086.1110785532@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY11-DAV4899E308FCFAA7E626003F85560@phx.gbl>
References: <BAY11-DAV4899E308FCFAA7E626003F85560@phx.gbl>

"Her Goo" <gu_he@msn.com> writes:
> I want to go a step further, and  restrict the results to those 
> that begin with string "abc\d".

You need four backslashes for that, because \ is special to both
the string literal parser and the LIKE operator.  So '\\\\'
reduces to a string constant containing \\, and then the LIKE
operator sees that as a quoted backslash.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <6086.1110785532@sss.pgh.pa.us>
Permalink:  ../6086.1110785532@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6086.1110785532@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gu_he@msn.com
  Subject: Re: sql: "LIKE" problem
  In-Reply-To: <6086.1110785532@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox