Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNI9v-00GFUc-0Q for pgsql-general@arkaria.postgresql.org; Sun, 23 Nov 2025 22:02:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNI9t-00Fkns-1K for pgsql-general@arkaria.postgresql.org; Sun, 23 Nov 2025 22:02:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNI9t-00Fknk-0F for pgsql-general@lists.postgresql.org; Sun, 23 Nov 2025 22:02:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNI9q-0016Ih-2j for pgsql-general@lists.postgresql.org; Sun, 23 Nov 2025 22:02:12 +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 5ANM24PV811313; Sun, 23 Nov 2025 17:02:04 -0500 From: Tom Lane To: =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= cc: pgsql-general@lists.postgresql.org Subject: Re: Restore Windows dump to Linux (locale issue) In-reply-to: References: Comments: In-reply-to =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= message dated "Mon, 24 Nov 2025 00:41:35 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <811311.1763935324.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 23 Nov 2025 17:02:04 -0500 Message-ID: <811312.1763935324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?=3D write= s: > I am using PostgreSQL 18.1 on a Windows system. > I need to move that database to a Linux system of the same version numbe= r. > Windows system use locales name as tr-TR (this is UTF-8 locale) > Linux system use locale name as tr_TR.UTF-8 > My cluster backup gives error at restore (I think because of that locale > naming difference) as below > psql:/db.dump:133: ERROR: invalid LC_COLLATE locale name: "tr-TR" Edit the dump so that the databases are created with Linux-compatible locale names. You should find lines like CREATE DATABASE foo WITH TEMPLATE =3D template0 ENCODING =3D 'UTF-8' LOCAL= E_PROVIDER =3D libc LOCALE =3D 'tr-TR'; (details will vary depending on PG version) and changing the locale strings ought to do the trick. If the dump file is too big for your editor, consider splitting it into schema-only and data-only dumps. regards, tom lane