how to escape _ in select - Mailing list pgsql-sql

From Wes James
Subject how to escape _ in select
Date
Msg-id AANLkTi=7K_xTEQSFaOX3=K_YDiNjvDedjcfBSTRpO240@mail.gmail.com
Whole thread Raw
Responses Re: how to escape _ in select  (Justin Graf <justin@magwerks.com>)
Re: how to escape _ in select  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: how to escape _ in select  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-sql
I'm trying to do this:

select * from table where field::text ilike '%\_%';

but it doesn't work.

How do you escape the _ and $ chars?

The docs say to use \, but that isn't working.

( http://www.postgresql.org/docs/8.3/static/functions-matching.html )

The text between '%...%' can be longer, I'm just trying to figure out
how to escape some things.  I've found that ' works with '' and \
works with \\

thx,

-wes


pgsql-sql by date:

Previous
From: Torsten Zühlsdorff
Date:
Subject: Re: [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them
Next
From: Justin Graf
Date:
Subject: Re: how to escape _ in select