Re: Search strings

From: "Doran L(dot) Barton" <fozz(at)iodynamics(dot)com>
To: Peter Landis <ntwebdeveloper(at)yahoo(dot)com>
Cc: Barnes <aardvark(at)ibm(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: Search strings
Date: 1999-12-29 22:36:56
Message-ID: 19991229153655.A11979@iodynamics.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Not long ago, Peter Landis proclaimed...
> I'm a newbie at postgresql and created a relational
> database with perl. What my question is, how do you
> do a string search in postgresql? I know you can
> search for string comparisons in oracle but was
> wondering if this is possible in postgresql? So far
> I've been using the SELECT syntax for finding words in
> the database, but this is assuming that the word is
> exactly the same. If anyone could advise me on this
> minor problem, I would greatly appreciate it.

Very possible. There are several string operators in PostgreSQL. One of my
favorite is ~* which does a case-insensitive regular expression search.

SELECT * FROM TABLE1 WHERE FIELD1 ~* 'dog';

Hope that helps.

-=Fozz

--
Doran L. Barton <fozz(at)iodynamics(dot)com>
Iodynamics LLC -- "Internetworking the masses"
<URL:http://www.iodynamics.com/>

In response to

  • at 1999-12-29 22:02:11 from Peter Landis

Browse pgsql-general by date

  From Date Subject
Next Message 武龍 1999-12-30 01:35:32 Re: [GENERAL] Admin / client tools for Win32?
Previous Message Thomas Reinke 1999-12-29 22:33:07 Re: