Re: Case insensitive selects?

Поиск
Список
Период
Сортировка
От Mitch Vincent
Тема Re: Case insensitive selects?
Дата
Msg-id 002701c09850$1d3370d0$0200000a@windows
обсуждение исходный текст
Ответ на Re: Case insensitive selects?  (David Wheeler <david@creationengines.com>)
Список pgsql-general
> Hmmm...I'd hate to have two indexes on every field I query like this, one
> case-senstive, one case-insensitve (like the one you create here). Is
> there a configuration option or something that will tell pgsql to do
> case-insensitive comparisons (kinda like MS SQL Server has)? That could
> save us on indexing overhead, since we want all of our WHERE comparisons
> to be case-insensitive, anyway.

If you want all of them to be case insensitive then make the upper ( or
lower() ) index and don't make any case sensitive queries! :-)

Make sure all your queries use upper() or lower() around the field and value
you're comparing and you're golden.. Unless I've misunderstood you, I don't
see the problem..

SELECT * FROM whatever WHERE lower(myfield) = lower('myvalue'); -- and make
your index on lower(myfield)... Viola!

-Mitch


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

Предыдущее
От: "Janardhan Sridhar"
Дата:
Сообщение: Easy creation of database driven web sites.
Следующее
От: Angelo DiSanto
Дата:
Сообщение: Question