Re:

From: De Moudt Walter <wdemoudt(at)planetinternet(dot)be>
To: Peter Landis <ntwebdeveloper(at)yahoo(dot)com>
Cc: Barnes <aardvark(at)ibm(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: Re:
Date: 1999-12-30 20:50:39
Message-ID: 386BC59F.E7DCE1A@planetinternet.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter,
Select is the good way, but use LIKE or ~ instead of = for your
comparison. It enables you to search on substrings of all kind.
SELECT * from my_table where text_field1 like '.....'
or ...text_field1 ~ '.....'
This operator has extensive features. You should consult the manual.
Some examples :
.... ~ '^D' begins with D
.... ~ 'D' contains D
.... ~ '^.D' has D in second place
.... ~* 'D' contains D or d
And so on. Really too much to mention. Hope this helps

Walter De Moudt

Peter Landis wrote:
>
> Hi-
>
> 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.
>
> Peter Landis
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://messenger.yahoo.com
>
> ************

In response to

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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-12-30 21:06:17 Re: PostgreSQL Portable Runtime (was Re: [GENERAL] Future of PostgreSQL)
Previous Message Robert 1999-12-30 20:42:47 PostgreSQL Portable Runtime (was Re: [GENERAL] Future of PostgreSQL)