Re: [ADMIN] locales and encodings Oh MY!

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [ADMIN] locales and encodings Oh MY!
Дата
Msg-id 14524.1289588633@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [ADMIN] locales and encodings Oh MY!  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [ADMIN] locales and encodings Oh MY!  (mark <dvlhntr@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
>> With how similar straight C and en_US.UTF8 are it was suggested to me,
>> by persons who are far more C knowledgeable then I in my office, that
>> this is something the PG community could "fix" . A "fix" being so that
>> "col LIKE 'foo%' " could use btree indexes in locales like en_US.UTF8
>> (and probably some others).

>> is the request unreasonable ? anyone got any idea of the price tag to
>> make that happen ?

> I thought it already did that.

No, and the odds of it ever happening are insignificant.  The sort order
associated with en_US (and other "dictionary order" locales) is just too
randomly different from what you need to optimize a LIKE search.
(Whoever told you en_US sorts similarly to C is nuts.)

The solution if you want the database's prevailing sort order to be en_US
is to put an extra text_pattern_ops index on the column you want to do
LIKE searches on.  We might eventually have the ability to spell that
"put a C-locale index on the column", but text_pattern_ops is the way to
do it today.

            regards, tom lane

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: WIP: extensible enums
Следующее
От: mark
Дата:
Сообщение: Re: [ADMIN] locales and encodings Oh MY!