RE: Simple Question: Case sensitivity - Mailing list pgsql-general

From Michael Ansley
Subject RE: Simple Question: Case sensitivity
Date
Msg-id 7F124BC48D56D411812500D0B747251480F32C@fileserver002.intecsystems.co.uk
Whole thread Raw
In response to Simple Question: Case sensitivity  ("Abe" <abe@fish.tm>)
List pgsql-general

Simply create a functional index:

CREATE INDEX foo ON employees (UPPER(firstname));

However, I have just tried this, and it doesn't work for some reason.  Anybody?

Cheers...

MikeA


-----Original Message-----
From: Tomas Berndtsson [mailto:tomas@nocrew.org]
Sent: 11 December 2000 10:49
To: Hancock, David (DHANCOCK)
Cc: 'pgsql-general@postgresql.org '
Subject: Re: [GENERAL] Simple Question: Case sensitivity

"Hancock, David (DHANCOCK)" <DHANCOCK@arinc.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

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
Nick West - Global Infrastructure Manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

pgsql-general by date:

Previous
From: Steve Heaven
Date:
Subject: RE: Regular expression question
Next
From: Tom Lane
Date:
Subject: Re: Simple Question: Case sensitivity