From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Durumdara <durumdara(at)gmail(dot)com> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Strange collation names ("hu_HU.UTF-8") |
Date: | 2022-08-02 13:43:19 |
Message-ID: | 2419928.1659447799@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Durumdara <durumdara(at)gmail(dot)com> writes:
> Today we found strange database collation names in a server (V11).
> "hu_HU.UTF-8"
> "hu_HU.UTF8"
> "hu_HU.utf8"
Yeah, these are all the same so far as the operating system is
concerned. I believe most if not all variants of Unix are
permissive about the spelling of the encoding part.
> What I don't understand, that if I query for collations, I got only this:
> hu_HU.utf8
pg_collation generally contains only "canonical" spellings of the locale
names, because initdb builds it from what "locale -a" prints. However,
different OS releases may have different ideas about which encoding name
is canonical.
> The whole problem appeared when we wanted to copy a database to a new (with
> defining the old as template).
> *Error: new collation (hu_HU.utf8) is incompatible with the collation of
> the template database (hu_HU.UTF-8)*
The code that checks that isn't as permissive as libc. You can spell
it exactly the same, or if you wanted to live dangerously you could
manually update the template database's pg_database entry to use the
currently-canonical spelling. (I'd try that in a scratch installation
first ...)
There was some discussion not long ago about relaxing the check
for "same collation name" [1], but no one has written a patch.
regards, tom lane
[1] https://www.postgresql.org/message-id/flat/fedc0205-c15b-e400-aa3f-e1d2a1285ddb%40sourcepole.ch
From | Date | Subject | |
---|---|---|---|
Next Message | jian he | 2022-08-02 14:38:58 | ICU is not supported in this build. install from source code. |
Previous Message | Ron | 2022-08-02 13:07:44 | Re: Syntax error when combining --set and --command has me stumped |