Re: utf8 vs UTF-8

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: utf8 vs UTF-8
Дата
Msg-id 2763159.1716045784@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: utf8 vs UTF-8  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 5/18/24 07:48, Troels Arvin wrote:
>> Also, when I try to create a database with "en_US.utf8" as locale 
>> without specifying a template:
>> 
>> troels=# create database test4 locale 'en_US.utf8';
>> ERROR:  new collation (en_US.utf8) is incompatible with the collation of 
>> the template database (en_US.UTF-8)
>> HINT:  Use the same collation as in the template database, or use 
>> template0 as template.

> I'm going to say that is Postgres being exact to a fault.

Yeah.  glibc will treat those two locale names as equivalent,
and I think most if not all other libc implementations do too.
But Postgres doesn't know that so it demands exact textual
equality before assuming two locale names are equivalent.

If this is getting in your way you could probably get away with
just UPDATE-ing pg_database to use whichever spelling you think is
preferable; the strings appearing in datcollate and datctype aren't
stored anywhere else.  (But experiment in a scratch installation to
verify that ... and don't try changing them to something that you
don't know to be semantically equivalent.)

            regards, tom lane



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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Left join syntax error
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Left join syntax error