pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Durumdara <durumdara@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Strange collation names ("hu_HU.UTF-8")
Date: Tue, 02 Aug 2022 09:43:19 -0400
Message-ID: <2419928.1659447799@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEcMXhmBGwM5SL7R7XSxqb7k_O0Sn4EoOdkeyj=jthvr0+u1_Q@mail.gmail.com>
References: <CAEcMXhmBGwM5SL7R7XSxqb7k_O0Sn4EoOdkeyj=jthvr0+u1_Q@mail.gmail.com>

Durumdara <durumdara@gmail.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





view thread (3+ messages)  latest in thread

Message-ID: <2419928.1659447799@sss.pgh.pa.us>
Permalink:  ../2419928.1659447799@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2419928.1659447799@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, durumdara@gmail.com
  Subject: Re: Strange collation names ("hu_HU.UTF-8")
  In-Reply-To: <2419928.1659447799@sss.pgh.pa.us>
  References: <CAEcMXhmBGwM5SL7R7XSxqb7k_O0Sn4EoOdkeyj=jthvr0+u1_Q@mail.gmail.com> <2419928.1659447799@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox