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 1oMt97-0001ng-Me for pgsql-novice@arkaria.postgresql.org; Sat, 13 Aug 2022 15:33:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oMt96-000387-6X for pgsql-novice@arkaria.postgresql.org; Sat, 13 Aug 2022 15:33:52 +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 1oMt95-00037x-TX for pgsql-novice@lists.postgresql.org; Sat, 13 Aug 2022 15:33:51 +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 1oMt93-0007OG-Kw for pgsql-novice@postgresql.org; Sat, 13 Aug 2022 15:33:51 +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 27DFXlDQ287928; Sat, 13 Aug 2022 11:33:47 -0400 From: Tom Lane To: stevetucknott@yahoo.co.uk cc: PostGreSQL Subject: Re: database encoding migration from a pg_dumpall set In-reply-to: References: Comments: In-reply-to Steve T message dated "Sat, 13 Aug 2022 16:10:10 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <287926.1660404827.1@sss.pgh.pa.us> Date: Sat, 13 Aug 2022 11:33:47 -0400 Message-ID: <287927.1660404827@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Steve T writes: > Is there an official way for migrating database encodings? Not via pg_dumpall. If you dump the databases individually, then you can create them manually on the target installation with whatever encoding (or other properties) you want, finishing by restoring the per-DB dumps into the respective new databases. Another way is to manually edit the pg_dumpall output script and change the encoding options in the CREATE DATABASE commands (but NOT the "SET client_encoding" commands). regards, tom lane