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 1vO0FS-005Paq-33 for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 21:06:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vO0FR-00BjLh-1n for pgsql-general@arkaria.postgresql.org; Tue, 25 Nov 2025 21:06:53 +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 1vO0FR-00BjLZ-0I for pgsql-general@lists.postgresql.org; Tue, 25 Nov 2025 21:06:53 +0000 Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vO0FP-001SMZ-04 for pgsql-general@lists.postgresql.org; Tue, 25 Nov 2025 21:06:52 +0000 Received: by mail-ua1-x931.google.com with SMTP id a1e0cc1a2514c-9354425df5cso3171016241.1 for ; Tue, 25 Nov 2025 13:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764104811; x=1764709611; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=y49mpCjgdpTNi5fd+cs7aqCdf8rwd2HPMfou6ELxT08=; b=Jetzo5aar9OUafRuVMM/fOeK/fiimd3S4TsHjg5SG9xaiDsmaYSh68VFQuoN3SghBE DvU0mFPt9hJJ92hHvYEtGBd3n937iyvCOOykqYpa8bzpxv0c+Y59eeL3AsSL9qktTYat FkiDPr6ge0nmtjRggvZ9h8el/uF0zmMhfLzN7Q271xedPGMvYVdLnjCLJ+Jadan3pT83 mpbLCFNUPKqM8kYUVRHmVLXW5oqw5CmCjtE1v1R71KYzDRZ42e1YlNxXbrOV0q7Im6xx CoZ8QbfsOoJ3mb83y3EYexUi+F4hmA0deHdzKal2wV+B7l2OgkfFGFgDQ8juKk2U6yyd xRdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764104811; x=1764709611; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=y49mpCjgdpTNi5fd+cs7aqCdf8rwd2HPMfou6ELxT08=; b=jpqJEb+yooxlNYdETyYb2ltDS/ukeV3mAg7AtKUKoX9iSJmD33qohWqgRz28sT+Zwp mnKXOks1zt+N/qILPkvpYbyTuRE1dWU/Qzs6A4RPD2oC1A2qShpIS1cgFPz+EzrmI1L8 o5K9tHO+/Q3aaRVMo6hKkZx7FeaoYT4tzL5hU4dgSBAWeqaEL2Rhr/OsIoj3r1FIX3E+ Zqf3Rcnt4cSfSzWb0cJ+u26oNv6W07vzopDwFWOAcDzwO77Jy7Q6EtXGADu3niMbwzN6 4pMhdpvTdTwK08EmTeK77Z1HvZKN6Y6OOeerDHIMqB+Zj2cTgAF42NDxlgldCTP7XMpp vDYg== X-Forwarded-Encrypted: i=1; AJvYcCW2OCLPC0x7Ykfo5DJVVAnDMLiYIYt1xxJwVnfyEW9uoJeFyRZ1bnEBoULLALmgFov6Lz9XJQpMAwOe9B30@lists.postgresql.org X-Gm-Message-State: AOJu0YxzPLvv/0XF8yOaOxvEEAYt8j61TPCGT5d4DMjwdHW3wNvm+Jcs S4+jN+SKqGzVsIMc+apxaKB0M1rfe3MzZBKmzEU+BPgUfgfQm1mOAjV6UaCnibdk6IRnRa4AbQ1 5Eq+e55YLXUKEF/on/2DfosfoIu+cynA= X-Gm-Gg: ASbGncs+mu9H8aoyBgrbAzqMagOT9gxnkilyhGRH8TORy0nG0uWyRTw5W47Gkg9rnOw kzxm36EUXQE96vmLma0MG7d1z06kVmsrA4pw0xaeGhdR3icG4QmInb9xOpbZT8u5iTqI3KVQBN+ EnokGJgLG6Tf8VcvVw9lAkxFACcIwpu8JZEEYbcoaZ6YhhTmAM9YCDU+dwXwPVPiiqkGJpyvU66 w2Z2lUoqP0YlhTOwKTUxvTUpuotdm4cI5f6EhTEuVyyCztb6lm3Nata0UphVU9HBbEzdqsVm4Go 2A+pM8qUu8tUNtseYzy4HlXZxAa8O1sr0l05fIm1v3DayXqLEzul3g4tbCd5veAmbzw8FasVDdU jScRA4ff4xdJRfVAnWidZ8ag8evOMv6SBcNA= X-Google-Smtp-Source: AGHT+IHX1O9wU6K3qRgttmwonBp8oB2Cn2DapeAj6MVlPV6rJG9+EhEfJ3aJwWKLJzIjTvNiF92ITYAlTCEagoTG4Do= X-Received: by 2002:a05:6102:32ca:b0:5db:9ab3:4291 with SMTP id ada2fe7eead31-5e2243dca66mr1842911137.33.1764104810819; Tue, 25 Nov 2025 13:06:50 -0800 (PST) MIME-Version: 1.0 References: <811312.1763935324@sss.pgh.pa.us> In-Reply-To: From: =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= Date: Wed, 26 Nov 2025 00:06:39 +0300 X-Gm-Features: AWmQ_blcIZl6IE7YIWA5wd5Jqv79oUxTeMMePMOqenHJSxzo2RKPumEmsXzDYTk Message-ID: Subject: Re: Restore Windows dump to Linux (locale issue) To: Brent Wood Cc: Tom Lane , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000987526064471a875" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000987526064471a875 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Brent Wood , 24 Kas 2025 Pzt, 01:42 tarihinde =C5=9F= unu yazd=C4=B1: > If the dump file is too big to edit conventionally, piping it through a > stream editor like sed to make the required changes works nicely. > It can be done on the fly in the restore process if required. > > Brent Wood > > Principal Technician, Fisheries > NIWA > DDI: +64 (4) 3860529 > ------------------------------ > *From:* Tom Lane > *Sent:* Monday, 24 November 2025 11:02 > *To:* Ertan K=C3=BC=C3=A7=C3=BCkoglu > *Cc:* pgsql-general@lists.postgresql.org < > pgsql-general@lists.postgresql.org> > *Subject:* Re: Restore Windows dump to Linux (locale issue) > > =3D?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?=3D writ= es: > > I am using PostgreSQL 18.1 on a Windows system. > > I need to move that database to a Linux system of the same version > number. > > 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 local= e > > 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' > LOCALE_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 > Hello, I manually created a database on the Linux system. Took a database backup and restored it on the Linux system. This way dump does not include any charset. Thanks & Regards, Ertan --000000000000987526064471a875 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Brent Wood <Brent.Wood@niwa.co.nz>, 24 Kas 2025 Pzt, 01:42 tarihi= nde =C5=9Funu yazd=C4=B1:
If the dump file is too big to edit conventionally, piping it through a str= eam editor like sed to make the required changes works nicely.
It can be done on the fly in the restore process if required.

Brent Wood

Principal Technician, Fisheries
NIWA
DDI:=C2=A0 +64 (4) 3860529

From: = Tom Lane <tgl@sss= .pgh.pa.us>
Sent: Monday, 24 November 2025 11:02
To: Ertan K=C3=BC=C3=A7=C3=BCkoglu <ertan.kucukoglu@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgre= sql.org>
Subject: Re: Restore Windows dump to Linux (locale issue)
=C2=A0
=3D?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?=3D <ertan.kucukoglu@gmail.com> wri= tes:
> I am using PostgreSQL 18.1 on a Windows system.
> I need to move that database to a Linux system of the same version num= ber.
> 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 loca= le
> naming difference) as below
> psql:/db.dump:133: ERROR:=C2=A0 invalid LC_COLLATE locale name: "= tr-TR"

Edit the dump so that the databases are created with Linux-compatible
locale names.=C2=A0 You should find lines like

CREATE DATABASE foo WITH TEMPLATE =3D template0 ENCODING =3D 'UTF-8'= ; LOCALE_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.

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regards, to= m lane

Hello,

I manually created a database on the=C2= =A0Linux system.
Took a database backup and restored it on the Li= nux system.
This way dump does not include any charset.

Thanks & Regards,
Ertan
--000000000000987526064471a875--