Re: Re: case insensitive database ? - Mailing list pgsql-novice

From Joel Burton
Subject Re: Re: case insensitive database ?
Date
Msg-id Pine.LNX.4.21.0104251256120.4608-100000@olympus.scw.org
Whole thread Raw
In response to case insensitive database ?  (Thorsten Mauch <mauch@imkenberg.de>)
List pgsql-novice
On Wed, 25 Apr 2001, Leandro Fanzone wrote:

> # select * from table where lower(field) ilike '%something%';
> ERROR:  parser: parse error at or near "ilike"

ILIKE is new in 7.1. With ILIKE, you don't have to use lower() -- the
point of ILIKE is to perform the comparison case-insensitively:

  SELECT * FROM table WHERE field ILIKE 'foobar';

> Another question: if I have an index on lower(field), does it make the like
> search faster? Excuse me if this question is too ignorant.

Not ignorant at all.

As long as PostgreSQL uses the index, it *should* be a good
performance boost. The subject of when PG decides to use an index, and
whether that always is a speed increase can be complicated -- the
Developer's manual covers some of the fine points.

--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


pgsql-novice by date:

Previous
From: David Olbersen
Date:
Subject: Re: SELECT performance problem on a join
Next
From: Thorsten Mauch
Date:
Subject: pg_dump libtermcap.so.2 not found