Re: locale

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: locale
Дата
Msg-id 13779.1081435169@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: locale  (Dennis Bjorklund <db@zigo.dhs.org>)
Ответы Re: locale  (Dennis Bjorklund <db@zigo.dhs.org>)
Список pgsql-hackers
Dennis Bjorklund <db@zigo.dhs.org> writes:
> On Thu, 8 Apr 2004, Tom Lane wrote:
>> See my previous point: the index does not actually fail, in our current
>> implementation, because strcoll() is unaffected by the database's
>> encoding setting.

> How can it be? If I have a utf-8 template1 and a table with an index
> sorted according to the utf-8 characters in some locale. Then this table
> and index is copied into a Latin1 database. When I interpret these bytes
> as Latin1 in the index, the ordering does not have to be the same as it 
> was before and the index can not be used.

No, the ordering *will* be the same as it was before, because strcoll()
is still functioning the same.  You'd get the same answer from a sort
operation since it depends on the same operators.

Now, you will probably complain that the sort order doesn't appear
correct according to your Latin1 interpretation --- and you're right.
But the index is not corrupt, it is still consistent in its own terms.

> I don't understand what you mean when you say that strcoll() is unaffected
> by the database's encoding setting. It interprets characters, how can it 
> not be?

It interprets them according to LC_CTYPE, which does not change.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL configuration
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: make == as = ?