Re: Restore Windows dump to Linux (locale issue)

From: Ertan Küçükoglu <ertan(dot)kucukoglu(at)gmail(dot)com>
To: Brent Wood <Brent(dot)Wood(at)niwa(dot)co(dot)nz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Restore Windows dump to Linux (locale issue)
Date: 2025-11-25 21:06:39
Message-ID: CAH2i4yeY=BYwNaKDJpZKo+eDgwrt2PF3aOkLAGVSJeCW76JOLg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brent Wood <Brent(dot)Wood(at)niwa(dot)co(dot)nz>, 24 Kas 2025 Pzt, 01:42 tarihinde şunu
yazdı:

> 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 <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> *Sent:* Monday, 24 November 2025 11:02
> *To:* Ertan Küçükoglu <ertan(dot)kucukoglu(at)gmail(dot)com>
> *Cc:* pgsql-general(at)lists(dot)postgresql(dot)org <
> pgsql-general(at)lists(dot)postgresql(dot)org>
> *Subject:* Re: Restore Windows dump to Linux (locale issue)
>
> =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= <ertan(dot)kucukoglu(at)gmail(dot)com> writes:
> > 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 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 = template0 ENCODING = 'UTF-8'
> LOCALE_PROVIDER = libc LOCALE = '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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Claeys 2025-11-25 21:08:40 Re: Schema design: user account deletion vs. keeping family tree data
Previous Message Adrian Klaver 2025-11-25 20:58:58 Re: Selecting all variations of job title in a list