Re: combining strings to make a query

From: Kevin Crain <kevin(dot)crain1(at)gmail(dot)com>
To: Wes James <comptekki(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: combining strings to make a query
Date: 2011-07-13 06:11:27
Message-ID: CADwm0aj5AF-ZnrrJZBhqrnCofz8CUuGjQZti9RTJ4KLfEhRYaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You can do full-text search in postgres now using ts_vectors. I'd
recommend going that route. Doing like comparisons is not a good idea
if you don't know the first part of the string you are searching
for....It appears to be much faster from my experience to search for
ab% than it is to search for %ab%.

On Tue, Jul 12, 2011 at 7:51 PM, Wes James <comptekki(at)gmail(dot)com> wrote:
> 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
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kevin Crain 2011-07-13 06:28:59 Re: Max column number.
Previous Message Kevin Crain 2011-07-13 05:56:42 Re: Max column number.