Bug #3924: Create Database with another encoding as the encoding from postgres - Mailing list pgsql-bugs

From Joe
Subject Bug #3924: Create Database with another encoding as the encoding from postgres
Date
Msg-id 4909AD5B.8060104@freedomcircle.net
Whole thread Raw
Responses Re: Bug #3924: Create Database with another encoding as the encoding from postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi,

I just run into this bug
(http://archives.postgresql.org/pgsql-bugs/2008-02/msg00010.php).  In my
case, Roundup (Python bug tracker) is trying to CREATE DATABASE WITH
ENCODING='UNICODE' in an 8.3.4 cluster created with LATIN1 encoding, and
it gets the error:

encoding UTF8 does not match server's locale en_US
DETAIL:  The server's LC_CTYPE setting requires encoding LATIN1.

Same problem if I try createdb -E UTF8.

Heikki's response to the OP referred him to the 8.3 release notes:

    Disallow database encodings that are inconsistent with the server's locale setting (Tom)



    On most platforms, C locale is the only locale that will work with
    any database encoding. Other locale settings imply a specific
    encoding and will misbehave if the database encoding is something
    different. (Typical symptoms include bogus textual sort order and
    wrong results from upper() or lower().) The server now rejects
    attempts to create databases that have an incompatible encoding.



I can understand that creating a LATIN2, EUC_CN or some other encoding
in a LATIN1 cluster may cause problems, but don't quite see how UTF-8
can be a problem since in essence it includes the others.  Perhaps
someone can provide further explanation?

Assuming this situation will remain as is in the immediate future, what
are my options?  The 8.3 cluster has a LATIN1 database that must stay
that way (at least for a while).  I also have an 8.2 LATIN1 cluster
where SQL_ASCII, LATIN1 and UTF8 appear to coexist happily but was in
the process of migrating the remaining db's to 8.3.  Do I need to create
another 8.3 cluster, this time with UTF8 encoding?  Will that be allowed
if my host LC_CTYPE remains "en_US" (the machine has both en_US.iso88591
and en_US.utf8 installed but operates mostly with the former)?

As an aside, how can one find the status of a Postgres bug?

Joe

pgsql-bugs by date:

Previous
From: "Stephen"
Date:
Subject: BUG #4503: failed to run initdb: 1!
Next
From: Tom Lane
Date:
Subject: Re: Bug #3924: Create Database with another encoding as the encoding from postgres