Re: Like problem - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Like problem
Date
Msg-id 47B31DEC.5050109@archonet.com
Whole thread Raw
In response to Like problem  ("Campbell, Lance" <lance@uiuc.edu>)
Responses Re: Like problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Like problem  ("Campbell, Lance" <lance@uiuc.edu>)
List pgsql-sql
Campbell, Lance wrote:
> 8.2.5
> 
> I am having an issue with trying to use 'LIKE' so that I can match on a
> string with an underscore in it.  What is the proper way to find the
> following string?

> WARNING:  nonstandard use of escape in a string literal
> 
> LINE 1: ...ct c1 from t1 where c1 like '%abc\_%';

Either indicate you are using an escaped string: LIKE E'%abc\_%'
Or, change the escape character: LIKE '%abcQ_%' ESCAPE 'Q'

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: "Campbell, Lance"
Date:
Subject: Like problem
Next
From: Tom Lane
Date:
Subject: Re: Like problem