pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Halil Han Badem <halilhanbadem@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows
Date: Wed, 15 Nov 2023 20:41:10 +0100
Message-ID: <d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at> (raw)
In-Reply-To: <CA+hfYg88ofsY8oknYiQmuc_3jiYu1kMVnJwY4=bE10+FYpG+Tg@mail.gmail.com>
References: <18196-b10f93dfbde3d7db@postgresql.org>
	<f41b857b00c92254e55a0e3486d76ad7ae1bde18.camel@cybertec.at>
	<CA+hfYg-rGc-O_LnS5M59HGbYufaGsQ6Sc4yBKucBQZLhoZE_7w@mail.gmail.com>
	<08bd5716d186595a226268a75c0fc24df89daa3a.camel@cybertec.at>
	<CA+hfYg88ofsY8oknYiQmuc_3jiYu1kMVnJwY4=bE10+FYpG+Tg@mail.gmail.com>

On Wed, 2023-11-15 at 21:47 +0300, Halil Han Badem wrote:
> In this case, the service starts, but you cannot establish a connection to the database.
> In other words, it gives the following error. This error is expected because the
> database was created with Turkish_Turkey.1254. Due to the name change to
> Turkish_Türkiye.1254, it cannot find the local name.
> 
> failed: FATAL: database locale is incompatible with operating system
> DETAIL: The database was initialized with LC_COLLATE "Turkish_Turkey.1254", which is not recognized by setlocale().
> HINT: Recreate the database with another locale or install the missing locale.

That was to be expected...

I cannot think of a good solution except to be Microsoft to unbreak their
software.  If you have not performed the Windows update on a system yet,
and you are bold enough, you could try the following hack:

- connect as superuser

- modify the catalog table with

    UPDATE pg_database
    SET datcollate = 'Turkish_Türkiye.1254',
        datctype = 'Turkish_Türkiye.1254'
    WHERE datcollate = 'Turkish_Turkey.1254';

- stop the PostgreSQL service

- edit "postgresql.conf" and change "Turkish_Turkey.1254" to "Turkish_Türkiye.1254" everywhere

- install the Windows update

- start the service

- in case the collation changed, REINDEX all indexes on string expressions

A safer option would be to dump the database before the upgrade
and restore the dump to a newly created cluster after the upgrade.

If you have used "Turkish_Turkey.1254" as explicit column collation
or somewhere else in your code, you will still run into problems.

This should really be fixed by Microsoft.

Yours,
Laurenz Albe





view thread (21+ messages)  latest in thread

Message-ID: <d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at>
Permalink:  ../d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at/
Also on:    postgresql.org/message-id/d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, halilhanbadem@gmail.com
  Subject: Re: BUG #18196: Databases Created in Turkish Language Will Not Run on the Latest Version of Windows
  In-Reply-To: <d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at>
  References: <18196-b10f93dfbde3d7db@postgresql.org> <f41b857b00c92254e55a0e3486d76ad7ae1bde18.camel@cybertec.at> <CA+hfYg-rGc-O_LnS5M59HGbYufaGsQ6Sc4yBKucBQZLhoZE_7w@mail.gmail.com> <08bd5716d186595a226268a75c0fc24df89daa3a.camel@cybertec.at> <CA+hfYg88ofsY8oknYiQmuc_3jiYu1kMVnJwY4=bE10+FYpG+Tg@mail.gmail.com> <d00d9a5c1f6a1a80d481be18499e28660ec97b23.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox