pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roland Dirlewanger <rd@dr15.cnrs.fr>
To: pgsql-interfaces@postgreSQL.org
Subject: case insensitive search in a column
Date: Tue, 25 May 1999 14:45:58 +0000
Message-ID: <374AB7A6.D6C313D0@dr15.cnrs.fr> (raw)


Hope the following problem is related enough to interfaces  ...

I'm looking for the most efficient way to look through a PGSQL database
with a case insensitive search.

I tried the following queries :
1. select * from mybase where myattr like 'word%';
2. select * from mybase where myattr ~* '^word';

The first one is case-sensitive. The second one matches my needs but is
about 5 or 6 times slower than the first one.

Before I start to convert the whole database in either lowercase or
uppercase, is there a way to fasten up case insensitive searches for
words a the begining of a column or even in the middle of a row ?

Thanks a lot in advance for your help.

--
Roland Dirlewanger
CNRS - Délégation Aquitaine et Poitou-Charentes
Esplanade des Arts et Métiers
33402 TALENCE CEDEX

Mél : rd@dr15.cnrs.fr, Tél : 05.57.35.58.52, Fax : 05.57.35.58.01




view thread (2+ messages)  latest in thread

Message-ID: <374AB7A6.D6C313D0@dr15.cnrs.fr>
Permalink:  ../374AB7A6.D6C313D0@dr15.cnrs.fr/
Also on:    postgresql.org/message-id/374AB7A6.D6C313D0@dr15.cnrs.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: rd@dr15.cnrs.fr
  Subject: Re: case insensitive search in a column
  In-Reply-To: <374AB7A6.D6C313D0@dr15.cnrs.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox