Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIsBB-0007W1-IA for pgsql-general@arkaria.postgresql.org; Tue, 02 Aug 2022 13:43:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIsBA-0003F0-1h for pgsql-general@arkaria.postgresql.org; Tue, 02 Aug 2022 13:43:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIsB9-0003Er-Nb for pgsql-general@lists.postgresql.org; Tue, 02 Aug 2022 13:43:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIsB7-0001gy-9Y for pgsql-general@postgresql.org; Tue, 02 Aug 2022 13:43:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 272DhJVd2419929; Tue, 2 Aug 2022 09:43:19 -0400 From: Tom Lane To: Durumdara cc: Postgres General Subject: Re: Strange collation names ("hu_HU.UTF-8") In-reply-to: References: Comments: In-reply-to Durumdara message dated "Tue, 02 Aug 2022 14:18:36 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2419927.1659447799.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 02 Aug 2022 09:43:19 -0400 Message-ID: <2419928.1659447799@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Durumdara 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 (w= ith > 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-e1d= 2a1285ddb%40sourcepole.ch