Re: Simple Question: Case sensitivity

Поиск
Список
Период
Сортировка
От Vince Vielhaber
Тема Re: Simple Question: Case sensitivity
Дата
Msg-id Pine.BSF.4.30.0012110921070.19745-100000@paprika.michvhf.com
обсуждение исходный текст
Ответ на Re: Simple Question: Case sensitivity  (Tomas Berndtsson <tomas@nocrew.org>)
Список pgsql-general
On 11 Dec 2000, Tomas Berndtsson wrote:

> "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.

You can create your index as upper or lower and it'll be used in a
select that uses upper().

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




В списке pgsql-general по дате отправления:

Предыдущее
От: "George Johnson"
Дата:
Сообщение: one other big mysql->postgresql item
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Regular expression question