Re: [despammed] How to search for a subString

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Kretschmer Andreas <andreas_kretschmer(at)despammed(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [despammed] How to search for a subString
Date: 2005-02-06 13:32:20
Message-ID: 20050206133220.GB952@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Sun, Feb 06, 2005 at 11:45:20 +0100,
Kretschmer Andreas <andreas_kretschmer(at)despammed(dot)com> wrote:
> am Sun, dem 06.02.2005, um 2:12:46 -0800 mailte b t folgendes:
> > Hi, I'm building a database for a school project and I want to search for the
> > name of the movie, fro example in the database there is a table called movie
> > and has a movie call "The fast and the furious" so if the type in "the fast"
> > then it should return that movie. I tried using like and ilike and it still
>
> select .. ~ '*the fast*' ...

That should be:
select .. ~ '.*the fast.*' ...

As REs are unanchored, you can simplify this to:
select .. ~ 'the fast' ...

However, ilike should have worked if it was used properly.

Also note that these searches are going to be slow, since they won't
be able to use an index. If you have so many movies that the speed of
the search is unacceptably slow, then you might want to look at the
tsearch2 contrib module.

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Frank Finner 2005-02-06 15:03:48 Re: [despammed] How to search for a subString
Previous Message Kretschmer Andreas 2005-02-06 10:45:20 Re: [despammed] How to search for a subString