Re: how to escape _ in select

From: Wes James <comptekki(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: how to escape _ in select
Date: 2010-07-28 20:23:15
Message-ID: AANLkTikS=b1K09JEUdxUyxDisCDRTryPp9BgbMm3pTq2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Jul 28, 2010 at 12:15 PM, Little, Douglas
<DOUGLAS(dot)LITTLE(at)orbitz(dot)com> wrote:
> Wes.
>
> You probably missed the part in bold.   You need to double the backslash.
>
> select 'ab5c' like '%\_c'
>
> t
>

Why doesn't this work?

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

WARNING: nonstandard use of \\ in a string literal

-wes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-07-28 20:44:59 Re: how to escape _ in select
Previous Message Wes James 2010-07-28 18:52:45 Re: how to escape _ in select