From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Oscar Carlberg <oscar.carlberg@fortnox.se>
To: pgsql-general@lists.postgresql.org
Subject: Re: ICU, locale and collation question
Date: Mon, 08 May 2023 22:07:34 +0200
Message-ID: <ae423dcf4beb77c20053bedb501400e01e5f2724.camel@cybertec.at> (raw)
In-Reply-To: <2a1de395-c69a-3dae-4459-dbdb633df637@fortnox.se>
References: <2a1de395-c69a-3dae-4459-dbdb633df637@fortnox.se>
On Mon, 2023-05-08 at 16:35 +0200, Oscar Carlberg wrote:
> We have a bunch of existing Postgres 10 clusters running on CentOS 7,
> which have been initialized (initdb) with these collation options;
>
> -E 'UTF-8'
> --lc-collate=sv_SE.UTF-8
> --lc-ctype=sv_SE.UTF-8
> --lc_monetary=sv_SE.UTF-8
> --lc-numeric=sv_SE.UTF-8
> --lc-time=sv_SE.UTF-8
> --lc-messages=en_US.UTF-8
>
> And createdb were provided with these locale options when setting up
> databases:
> --lc-collate=sv_SE.UTF-8
> --lc-ctype=sv_SE.UTF-8
>
> We're upgrading the servers using logical replication, and would like to
> take the opportunity to switch to ICU rather than relying on glibc, to
> avoid future problems with index corruption if using physical
> replication between servers with different versions of glibc.
>
> We're trying to figure out the most correct way to configure postgres to
> achieve this. Currently we have:
>
> -E 'UTF-8'
> --locale-provider=icu
> --icu-locale=sv-SE-x-icu
>
> And createdb are provided with locale options:
> --lc-collate=C
> --lc-ctype=C
>
> Is this a safe configuration to avoid index corruption, and other
> problems, while still being compatible with the previous locale
> settings?
Yes, that is safe.
But it is not compatible with the old setup when it comes to lc_time,
lc_messages and the others. You should use sv_SE.UTF-8 for these
locale categories.
Note that that won't cause problems with upgrading the C library.
Yours,
Laurenz Albe
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-general@postgresql.org
Cc: laurenz.albe@cybertec.at, oscar.carlberg@fortnox.se
Subject: Re: ICU, locale and collation question
In-Reply-To: <ae423dcf4beb77c20053bedb501400e01e5f2724.camel@cybertec.at>
References: <2a1de395-c69a-3dae-4459-dbdb633df637@fortnox.se> <ae423dcf4beb77c20053bedb501400e01e5f2724.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