pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
AW: [Extern] Re: ICU database?
3+ messages / 2 participants
[nested] [flat]

* AW: [Extern] Re: ICU database?
@ 2026-08-05 14:48 ` Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>
  2026-08-05 14:56   ` Re: AW: [Extern] Re: ICU database? Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2026-08-05 14:48 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

PG18

Debian Trixie

de_CH.utf-8



> -----Ursprüngliche Nachricht-----
> Von: Adrian Klaver <adrian.klaver@aklaver.com>
> Gesendet: Mittwoch, 5. August 2026 16:12
> An: Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>; pgsql-
> general@lists.postgresql.org
> Betreff: [Extern] Re: ICU database?
> 
> --- Externe Email: Vorsicht mit Anhängen, Links oder dem Preisgeben von
> Informationen ---
> 
> On 8/5/26 5:55 AM, Zwettler Markus (OIZ) wrote:
> > I'm creating a PG cluster with Swiss High German ICU locales.
> 
> What Postgres version?
> 
> What OS and version?
> 
> What is the OS locale?
> 
> >
> >
> >
> > 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'
> >
> > ;
> >
> > postgres=# \l
> >
> >                                                     List of databases
> >
> >     Name    |  Owner   | Encoding | Locale Provider | Collate | Ctype |
> >     Locale    | ICU Rules |   Access privileges
> >
> > -----------+----------+----------+-----------------+---------+-------
> > +-------------+-----------+-----------------------
> >
> > eng001    | dbowner  | UTF8     | icu             | C       | C     |
> > de-CH-x-icu |           | =CTc/dbowner         +
> >
> >             |          |          |                 |         |       |
> >               |           | dbowner=CTc/dbowner
> >
> > postgres  | postgres | UTF8     | icu             | C       | C     |
> > de-CH-x-icu |           |
> >
> > template0 | postgres | UTF8     | icu             | C       | C     |
> > de-CH-x-icu |           | =c/postgres          +
> >
> >             |          |          |                 |         |       |
> >               |           | postgres=CTc/postgres
> >
> > template1 | postgres | UTF8     | icu             | C       | C     |
> > de-CH-x-icu |           | =c/postgres          +
> >
> >             |          |          |                 |         |       |
> >               |           | postgres=CTc/postgres
> >
> > (4 rows)
> >
> >
> >
> 
> 
> --
> Adrian Klaver
> adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: AW: [Extern] Re: ICU database?
  2026-08-05 14:48 ` AW: [Extern] Re: ICU database? Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>
@ 2026-08-05 14:56   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-08-05 14:56 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

"Zwettler Markus (OIZ)" <markus.zwettler@zuerich.ch> writes:
> Name    |  Owner   | Encoding | Locale Provider | Collate | Ctype |
> Locale    | ICU Rules |   Access privileges
> 
> -----------+----------+----------+-----------------+---------+-------
> +-------------+-----------+-----------------------
> 
> eng001    | dbowner  | UTF8     | icu             | C       | C     |
> de-CH-x-icu |           | =CTc/dbowner         +
> 
> |          |          |                 |         |       |
> |           | dbowner=CTc/dbowner

I believe those columns reflect the libc locale settings that are
being used.  They don't affect behavior that is driven by ICU ...
but not everything is.  You would likely want to set LANG=de_DE
or the like during initdb, along with specifying the ICU locale.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* AW: [Extern] Re: ICU database?
@ 2026-08-10 12:12 ` Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>
  1 sibling, 0 replies; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2026-08-10 12:12 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

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.albe@cybertec.at>
> Gesendet: Donnerstag, 6. August 2026 08:25
> An: Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>; pgsql-
> general@lists.postgresql.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


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-08-10 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-05 14:48 ` Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>
2026-08-05 14:56   ` Tom Lane <tgl@sss.pgh.pa.us>
2026-08-10 12:12 ` Zwettler Markus (OIZ) <markus.zwettler@zuerich.ch>

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