Re: locale

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgman(at)candle(dot)pha(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: locale
Date: 2004-04-08 14:39:29
Message-ID: 13779.1081435169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dennis Bjorklund <db(at)zigo(dot)dhs(dot)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

In response to

  • Re: locale at 2004-04-08 14:16:11 from Dennis Bjorklund

Responses

  • Re: locale at 2004-04-08 15:31:59 from Dennis Bjorklund

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-04-08 14:51:05 Re: make == as = ?
Previous Message Tom Lane 2004-04-08 14:31:44 Re: PostgreSQL configuration