Re: Unicode vs SQL_ASCII DBs - Mailing list pgsql-general

From Tom Lane
Subject Re: Unicode vs SQL_ASCII DBs
Date
Msg-id 9463.1075734667@sss.pgh.pa.us
Whole thread Raw
In response to Re: Unicode vs SQL_ASCII DBs  (Kris Jurka <books@ejurka.com>)
List pgsql-general
Kris Jurka <books@ejurka.com> writes:
> On Mon, 2 Feb 2004, John Sidney-Woollett wrote:
>> Except that in my test, the two differently encoded databases were in the
>> same 7.4.1 cluster with the same locale, yet they sorted the *same* data
>> differently - implying the encoding is a factor.

> Right, note the "and you must choose an encoding that works with your
> locale." clause.  A SQL_ASCII encoding and a UTF-8 locale don't work.

In practice, any given locale setting assumes a particular encoding and
will not work if some other encoding is used.  For instance, on recent
Red Hat releases:

$ locale -a | grep ^de_DE
de_DE
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
de_DE.utf8@euro
de_DE@euro

I'm not too sure which encoding "de_DE" uses, but the other two are
clearly named to reflect their expected encoding.

It is really a bug that PG allows you to select incompatible locale and
encoding settings.  We'd fix it if we could figure out a portable way of
determining which encoding a locale expects --- unfortunately the
standard APIs for libc omit this information ...

            regards, tom lane

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0
Next
From: Martin Marques
Date:
Subject: Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0