Re: Why do we let CREATE DATABASE reassign encoding?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why do we let CREATE DATABASE reassign encoding?
Дата
Msg-id 2276.1240513225@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why do we let CREATE DATABASE reassign encoding?  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: Why do we let CREATE DATABASE reassign encoding?  (Andrew Dunstan <andrew@dunslane.net>)
Re: Why do we let CREATE DATABASE reassign encoding?  ("David E. Wheeler" <david@kineticode.com>)
Re: Why do we let CREATE DATABASE reassign encoding?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> So the following sequence woiuld be illegal:

> initdb -E latin1
> createdb -E utf8

Yes, that's rather the point.  Note that it already *is* illegal
unless you happen to have selected C locale; AFAICS that is an
oversight and not intentional.  For instance, going in the other
direction in en_US locale, I get

$ createdb -E latin1 l1
createdb: database creation failed: ERROR:  encoding LATIN1 does not match locale en_US.utf8
DETAIL:  The chosen LC_CTYPE setting requires encoding UTF8.

You can get around this by cloning template0 instead of template1
(we assume template0 contains nothing that's encoding-specific).
Possibly the docs will need to be improved to emphasize that.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Why do we let CREATE DATABASE reassign encoding?
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Why do we let CREATE DATABASE reassign encoding?