BUG #3924: Create Database with another encoding as the encoding from postgres

Lists: pgsql-bugs
From: "Stefan Kunick" <stefan(at)kunick(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3924: Create Database with another encoding as the encoding from postgres
Date: 2008-02-02 19:01:08
Message-ID: 200802021901.m12J18lt096024@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3924
Logged by: Stefan Kunick
Email address: stefan(at)kunick(dot)org
PostgreSQL version: 8.3RC2
Operating system: Windows Longhorn
Description: Create Database with another encoding as the encoding
from postgres
Details:

I installed postgres with the encoding 1252. After this, i started the
program createdb (createdb -E LATIN1 -O postgres -p 5555 -U postgres). The
program stopped with the error message: createdb: database creation failed.
Error: encoding LATIN1 does not match server's locale German_Germany.1252
DETAIL: The server's LC_CTYPE setting requires encoding WIN1252.

With the former version 8.2, i can create a database with other encoding


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Cc: "Stefan Kunick" <stefan(at)kunick(dot)org>
Subject: Re: BUG #3924: Create Database with another encoding as the encoding from postgres
Date: 2008-02-02 19:45:12
Message-ID: 200802022045.13439.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Stefan Kunick wrote:
> I installed postgres with the encoding 1252. After this, i started the
> program createdb (createdb -E LATIN1 -O postgres -p 5555 -U postgres). The
> program stopped with the error message: createdb: database creation failed.
> Error: encoding LATIN1 does not match server's locale German_Germany.1252
> DETAIL: The server's LC_CTYPE setting requires encoding WIN1252.
>
> With the former version 8.2, i can create a database with other encoding

You could, but the result wouldn't have worked correctly. You need to pick
locales and encodings that match. This was always true, but not it is
enforced.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Stefan Kunick" <stefan(at)kunick(dot)org>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3924: Create Database with another encoding as the encoding from postgres
Date: 2008-02-02 20:35:12
Message-ID: 47A4D400.2030200@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Stefan Kunick wrote:
> PostgreSQL version: 8.3RC2
> Operating system: Windows Longhorn
> Description: Create Database with another encoding as the encoding
> from postgres
> Details:
>
> I installed postgres with the encoding 1252. After this, i started the
> program createdb (createdb -E LATIN1 -O postgres -p 5555 -U postgres). The
> program stopped with the error message: createdb: database creation failed.
> Error: encoding LATIN1 does not match server's locale German_Germany.1252
> DETAIL: The server's LC_CTYPE setting requires encoding WIN1252.
>
> With the former version 8.2, i can create a database with other encoding

Yes, that's an intentional change. From 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.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: "Pit M(dot)" <fmi-soft(at)gmx(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3924: Create Database with another encoding as the encoding from postgres
Date: 2008-02-06 15:10:16
Message-ID: focikj$soa$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Heikki Linnakangas wrote:
> Yes, that's an intentional change. From release notes:
I had the same problem this morning. We provide a sample database with
LATIN1 encoding (included in our setup). So how can i change my encoding
to have a database that can be used with PG 8.1; 8.1; 8.2 and 8.3
without problems and without knowing how the server was installed? What
is the required encoding as LATIN1 was the encoding we prefered. We
don't want to use UNICODE.

Regards

Pit


From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Pit M(dot)" <fmi-soft(at)gmx(dot)de>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: BUG #3924: Create Database with another encoding as the encoding from postgres
Date: 2008-02-08 14:05:47
Message-ID: 47AC61BB.3010608@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Pit M. wrote:
> I had the same problem this morning. We provide a sample database with
> LATIN1 encoding (included in our setup). So how can i change my encoding
> to have a database that can be used with PG 8.1; 8.1; 8.2 and 8.3
> without problems and without knowing how the server was installed? What
> is the required encoding as LATIN1 was the encoding we prefered.

How exactly are you providing the sample database? If it's in a pg_dump
format, it should work regardless of the encoding and locale used in initdb.

If you're issuing a CREATE DATABASE command, can't just don't specify
any encoding and let it use the default?

> We don't want to use UNICODE.

Why not?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com