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 1o49k5-0006i4-4z for pgsql-general@arkaria.postgresql.org; Wed, 22 Jun 2022 23:26:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o49k4-0004jE-0f for pgsql-general@arkaria.postgresql.org; Wed, 22 Jun 2022 23:26:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o49k3-0004j5-Mx for pgsql-general@lists.postgresql.org; Wed, 22 Jun 2022 23:26:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o49k1-0002WL-NX for pgsql-general@lists.postgresql.org; Wed, 22 Jun 2022 23:26:35 +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 25MNQTed3696627; Wed, 22 Jun 2022 19:26:30 -0400 From: Tom Lane To: Tomas Pospisek cc: Adrian Klaver , pgsql-general@lists.postgresql.org Subject: Re: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_US.utf-8) In-reply-to: References: <8c998edf-82a1-0769-77d7-7ef5076c098c@aklaver.com> Comments: In-reply-to Tomas Pospisek message dated "Wed, 22 Jun 2022 22:18:08 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3696625.1655940389.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 22 Jun 2022 19:26:29 -0400 Message-ID: <3696626.1655940389@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Pospisek writes: > On 22.06.22 21:25, Adrian Klaver wrote: >> On 6/22/22 12:17, Tomas Pospisek wrote: >>> If I `pg_dump --create` some DB on the new server (13.7-1.pgdg18.04+1) >>> I get: >>> >>>      CREATE DATABASE ... ENCODING = 'UTF8' LOCALE = 'en_US.utf-8'; >>> >>> When I do the same on the old server (12.8-1.pgdg20.04+1) I get: >>> >>>      CREATE DATABASE ... ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' >>> LC_CTYPE = 'en_US.UTF-8'; >> Are dumping/restoring from one version of Postgres to another? > Yes, indeed! This is probably more about dumping from different operating systems. The spelling of the locale name is under the control of the OS, and Postgres doesn't know very much about the semantics of it (so I think we conservatively assume that any difference in spelling is significant). Best bet might be to edit the dump file to adjust the locale spellings to match your new system. regards, tom lane