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 1o46o5-0008E0-8Z for pgsql-general@arkaria.postgresql.org; Wed, 22 Jun 2022 20:18:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o46o3-0003qO-VO for pgsql-general@arkaria.postgresql.org; Wed, 22 Jun 2022 20:18:31 +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 1o46o3-0003qE-Kt for pgsql-general@lists.postgresql.org; Wed, 22 Jun 2022 20:18:31 +0000 Received: from brisi.sourcepole.ch ([5.9.57.43]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o46nn-0002g0-SC for pgsql-general@lists.postgresql.org; Wed, 22 Jun 2022 20:18:30 +0000 Received: from [213.55.224.206] (helo=[192.168.43.81]) by vilan-mail with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o46nl-00050o-8x; Wed, 22 Jun 2022 22:18:13 +0200 Message-ID: Date: Wed, 22 Jun 2022 22:18:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_US.utf-8) Content-Language: en-GB To: Adrian Klaver , pgsql-general@lists.postgresql.org References: <8c998edf-82a1-0769-77d7-7ef5076c098c@aklaver.com> From: Tomas Pospisek In-Reply-To: <8c998edf-82a1-0769-77d7-7ef5076c098c@aklaver.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 22.06.22 21:25, Adrian Klaver wrote: > On 6/22/22 12:17, Tomas Pospisek wrote: >> Hi all, >> >> while doing `cat pg_dump.dump | psql` I get the above message. Note >> that `pg_dump.dump` contains: >> >>      CREATE DATABASE some_db WITH TEMPLATE = my_own_template ENCODING >> = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8'; >> >> What is exactly the problem? I understand that en_US.UTF-8 and >> en_US.utf-8 is not *exactly* the same string. >> >> However I do not understand how the difference came to be. And I do >> not know what the "right" way is and how to proceed from here. >> >> 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'; >> >> Any hints or help? > > Are dumping/restoring from one version of Postgres to another? Yes, indeed! > If from older to newer then use the new version of pg_dump(13) to dump > the older(12) database. Then the 13 version of restore to load the > version 13 database. I will. Thanks a lot Adrian! *t