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 <[email protected]>
> Gesendet: Donnerstag, 6. August 2026 08:25
> An: Zwettler Markus (OIZ) <[email protected]>; pgsql-
> [email protected]
> 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