Обсуждение: BUG #3792: cluster in UTF deny database in LATIN2

Поиск
Список
Период
Сортировка

BUG #3792: cluster in UTF deny database in LATIN2

От
"Marek"
Дата:
The following bug has been logged online:

Bug reference:      3792
Logged by:          Marek
Email address:      wrobel.marek@gmail.com
PostgreSQL version: 8.3beta3
Operating system:   Linux  2.6.23.1-49.fc8 #1 SMP x86_64
Description:        cluster in UTF deny database in LATIN2
Details:

This postgresql was compiled myself.
I have cluster inited in UTF-8.

createdb -U postgres -E 'latin2' foo

createdb: database creation failed: ERROR:  encoding LATIN2 does not match
server's locale pl_PL.UTF-8
The server's LC_CTYPE setting requires encoding UTF8.

When I install postresql 8.2 from rpm an init cluster as UTF, I don't have
any problem to create database in LATIN2.

Re: BUG #3792: cluster in UTF deny database in LATIN2

От
Heikki Linnakangas
Дата:
Marek wrote:
> Bug reference:      3792
> Logged by:          Marek
> Email address:      wrobel.marek@gmail.com
> PostgreSQL version: 8.3beta3
> Operating system:   Linux  2.6.23.1-49.fc8 #1 SMP x86_64
> Description:        cluster in UTF deny database in LATIN2
> Details:
>
> This postgresql was compiled myself.
> I have cluster inited in UTF-8.
>
> createdb -U postgres -E 'latin2' foo
>
> createdb: database creation failed: ERROR:  encoding LATIN2 does not match
> server's locale pl_PL.UTF-8
> The server's LC_CTYPE setting requires encoding UTF8.
>
> When I install postresql 8.2 from rpm an init cluster as UTF, I don't have
> any problem to create database in LATIN2.

That's intentional. You're trying to use a UTF-8 locale, with LATIN2
encoding. That's not going to work properly. We used to be lax about
that, but in 8.3 we check that the encoding matches the encoding the
locale expects, and throw an error if they don't.

Hmm, apparently that's not mentioned in the release notes. It probably
should be.

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

Re: BUG #3792: cluster in UTF deny database in LATIN2

От
Tom Lane
Дата:
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> Marek wrote:
>> createdb: database creation failed: ERROR:  encoding LATIN2 does not match
>> server's locale pl_PL.UTF-8
>> The server's LC_CTYPE setting requires encoding UTF8.

> That's intentional. You're trying to use a UTF-8 locale, with LATIN2
> encoding. That's not going to work properly. We used to be lax about
> that, but in 8.3 we check that the encoding matches the encoding the
> locale expects, and throw an error if they don't.

> Hmm, apparently that's not mentioned in the release notes. It probably
> should be.

Yeah, not sure how we missed that :-(.  Added.

            regards, tom lane