combining strings to make a query

From: Wes James <comptekki(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: combining strings to make a query
Date: 2011-07-13 02:51:09
Message-ID: CAFjCMHtpbUh6Q-=aJmkC=XpTYVqiPUXkK9KYW09rcZLTYVgPig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm using Erlang and postgresql to build a web interface. When I
create the query string I get something like:

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

But when I do that (if someone types in '\' for part of the text
search), I get a pg log entry to use E'\\'

How would I use E'' with ilike '%%'. ilike E'%\\%' doesn't work.

Thanks,

-wes

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kevin Crain 2011-07-13 04:57:09 Re: interesting sequence
Previous Message Miguel Angel Conte 2011-07-12 23:29:57 Re: Max column number.