Re: Upgrading from postgresql 11 to postgresql 17 using pg_upgrade

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Upgrading from postgresql 11 to postgresql 17 using pg_upgrade
Date: 2025-09-19 04:50:30
Message-ID: b57940e8-0696-43d0-aeb8-61bd9a71eb3e@jakobs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Am 18.09.25 um 14:11 schrieb Muhammet Kurtoğlu:
> Hi
>  during upgrade we encounter
>
> pg_restore: error: could not execute query: ERROR: encoding "UTF8"
> does not match locale "tr_TR.iso88599" DETAIL: The chosen LC_CTYPE
> setting requires encoding "LATIN5". Command was: CREATE DATABASE "zzz"
> WITH TEMPLATE = template0 OID = 84322 ENCODING = 'UTF8'
> LOCALE_PROVIDER = libc LOCALE = 'tr_TR.iso88599' TABLESPACE = "zz";
>
> postgresql 11 database list
>
>
> image.png
>
> please help
>
>
>
>
> --
>
> *Muhammet KURTOĞLU*
>
> T: +90(312) 220 12 20 <tel:%2B90%28374%29%20262%2098%2000>
>
> F: +90(312) 286 00 10 <tel:%2B90%28374%29%20262%2090%2091>
>
> muhammet(dot)kurtoglu(at)bisoft(dot)com(dot)tr <mailto:caner(dot)olkan(at)bisoft(dot)com(dot)tr>
>
>
>
>
>
Hi Muhammet,

You aren't using pg_upgrade as you are saying in the subject line, but
pg_restore for restoring, which means you did a pg_dump -Fc before.

In order to avoid the errors you have encountered, the safest bet ist
ALWAYS to use UTF8. Use UTF8 as encoding for ALL databases, and Collate
and CType language_country.UTF-8, in your case tr_TR.UTF-8. Don't bother
with the outdated iso8859x character sets.

UTF8 can handle all characters from all languages, special characters,
emojis and so on.

Make sure that the database cluster also has been initialised with the
correct encoding. Check whether the encoding of template1 database is
the same. Otherwise, run the initdb command again with correct settings,
see manpage of initdb.

This command works nonetheless

create database kurt with encoding = utf8 locale = tr_TR lc_collate =
'tr_TR.UTF-8' lc_ctype = 'tr_TR.UTF-8' locale_provider = libc template =
template0;

Selamlar

Holger

--

Holger Jakobs, Bergisch Gladbach, Germany

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message concur dev 2025-09-19 05:01:27 Re: Upgrading from postgresql 11 to postgresql 17 using pg_upgrade
Previous Message David G. Johnston 2025-09-19 04:17:50 Re: pgping?