Strange collation names ("hu_HU.UTF-8")

From: Durumdara <durumdara(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Strange collation names ("hu_HU.UTF-8")
Date: 2022-08-02 12:18:36
Message-ID: CAEcMXhmBGwM5SL7R7XSxqb7k_O0Sn4EoOdkeyj=jthvr0+u1_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Members!

Today we found strange database collation names in a server (V11).

select -- datname,
distinct datcollate
from pg_database
order by datcollate --, datname;

"hu_HU.UTF-8"
"hu_HU.UTF8"
"hu_HU.utf8"

The PGAdmin also gives us these possible collations in the dialog.
Some of the databases were migrated from 9.6 by Python script, and we used
"hu_HU.UTF-8"
to create the empty databases before restoring them.

What I don't understand, that if I query for collations, I got only this:

SELECT *
FROM pg_collation
where upper(collname) like '%HU%' -- and upper(collname) like '%UTF%'
order by collname

hu_HU.utf8

This collation ("hu_HU.UTF-8") doesn't cause any problems, and PGSQL V11
accepts it.

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)*

So maybe the UTF-8 isn't valid but the PG accepted that???
Or is it valid and inherited from 9.6?

Please help me a little bit! Thank you!

Best regards
dd

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2022-08-02 13:07:44 Re: Syntax error when combining --set and --command has me stumped
Previous Message Gavan Schneider 2022-08-02 07:43:14 Re: Creation of FK without enforcing constraint for existing data