AW: [Extern] Re: ICU database?

From: "Zwettler Markus (OIZ)" <markus(dot)zwettler(at)zuerich(dot)ch>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: AW: [Extern] Re: ICU database?
Date: 2026-08-10 12:12:22
Message-ID: GV0P278MB009980665B027058111FB2F08BDE2@GV0P278MB0099.CHEP278.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using cloudnative-pg.

I had to define everything there - even localeCollate(LC_COLLATE) and localeCType(LC_CTYPE) - to get that working:
...
initdb:
...
localeProvider: icu
icuLocale: de-CH
locale: de_CH.utf8
localeCollate: de_CH.utf8
localeCType: de_CH.utf8
encoding: UTF8
...

postgres=# \l
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+------------+------------+--------+-----------+-----------------------
eng001 | dbowner | UTF8 | icu | de_CH.utf8 | de_CH.utf8 | de-CH | | =CTc/dbowner +
| | | | | | | | dbowner=CTc/dbowner
postgres | postgres | UTF8 | icu | de_CH.utf8 | de_CH.utf8 | de-CH | |
template0 | postgres | UTF8 | icu | de_CH.utf8 | de_CH.utf8 | de-CH | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | icu | de_CH.utf8 | de_CH.utf8 | de-CH | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
(4 rows)

Thanks, Markus

> -----Ursprüngliche Nachricht-----
> Von: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
> Gesendet: Donnerstag, 6. August 2026 08:25
> An: Zwettler Markus (OIZ) <markus(dot)zwettler(at)zuerich(dot)ch>; pgsql-
> general(at)lists(dot)postgresql(dot)org
> Betreff: [Extern] Re: ICU database?
>
> --- Externe Email: Vorsicht mit Anhängen, Links oder dem Preisgeben von
> Informationen ---
>
> On Wed, 2026-08-05 at 12:55 +0000, Zwettler Markus (OIZ) wrote:
> > I'm creating a PG cluster with Swiss High German ICU locales.
> >
> > I wonder why “collate = C” and “ctype = C” is shown?
> >
> > initdb --locale-provider=icu --icu-locale=de-CH-x-icu -D
> > /path/to/datainitdb
> >
> > CREATE DATABASE eng001
> > WITH
> > OWNER = dbowner
> > ENCODING = 'UTF8'
> > LOCALE_PROVIDER = 'icu'
> > ICU_LOCALE = 'de-CH-x-icu'
> > ;
>
> That's because you didn't specify a C library locale, so "initdb" took the setting
> from your shell environment.
>
> Try:
>
> initdb --locale-provider=icu --icu-locale=de-CH --locale=de_CH.utf8 -D
> /path/to/datainitdb
>
> Many aspects of the locale are still taken from the C library. It's mostly the
> collations that will be taken from ICU.
>
> Yours,
> Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ray O'Donnell 2026-08-11 21:32:52 SQL help:
Previous Message Daniel Gustafsson 2026-08-07 06:31:42 Re: analyze-in-stages post upgrade questions