Re: Simple Question: Case sensitivity

From: Tomas Berndtsson <tomas(at)nocrew(dot)org>
To: "Hancock, David (DHANCOCK)" <DHANCOCK(at)arinc(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org '" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Simple Question: Case sensitivity
Date: 2000-12-11 10:48:39
Message-ID: 80wvd71beg.fsf@junk.nocrew.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Hancock, David (DHANCOCK)" <DHANCOCK(at)arinc(dot)com> writes:

> Abe: It's an SQL thing or a scripting thing. It's probably easiest and
> safest in the SQL:
>
> select firstname, surname from employees
> where upper(firstname) like upper('%$criteria%') or
> upper(surname) like upper('%$criteria%')
>
> That is, force the column and the search string to uppercase befor
> comparing, and it won't matter how it's stored in the database.

Related to this, is there any way to make an index for a table
case-insensitive? If you have an index, but use upper() in the select,
the index is not used.

Tomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Heaven 2000-12-11 11:09:56 Regular expression question
Previous Message Zeugswetter Andreas SB 2000-12-11 08:41:10 AW: Oracle-compatible lpad/rpad behavior