pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <myon@debian.org>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add option to use ICU as global locale provider
Date: Sat, 19 Mar 2022 18:53:30 +0100
Message-ID: <YjYYmsLr9mzqI4Jq@msg.df7cb.de> (raw)
In-Reply-To: <E1nUnH5-0006aR-MX@gemulon.postgresql.org>
References: <E1nUnH5-0006aR-MX@gemulon.postgresql.org>

Re: Peter Eisentraut
> Since some (legacy) code still uses the libc locale facilities
> directly, we still need to set the libc global locale settings even if
> ICU is otherwise selected.  So pg_database now has three
> locale-related fields: the existing datcollate and datctype, which are
> always set, and a new daticulocale, which is only set if ICU is
> selected.  A similar change is made in pg_collation for consistency,
> but in that case, only the libc-related fields or the ICU-related
> field is set, never both.

Since the intended usage seems to be that databases should either be
using libc, or the ICU locales, but probably not both at the same
time, does it make sense to clutter the already very wide `psql -l`
output with two new extra columns?

This hardly fits in normal-size terminals:

=# \l
                                             List of databases
   Name    │ Owner │ Encoding │  Collate   │   Ctype    │ ICU Locale │ Locale Provider │ Access privileges
───────────┼───────┼──────────┼────────────┼────────────┼────────────┼─────────────────┼───────────────────
 postgres  │ myon  │ UTF8     │ de_DE.utf8 │ de_DE.utf8 │            │ libc            │
 template0 │ myon  │ UTF8     │ de_DE.utf8 │ de_DE.utf8 │            │ libc            │ =c/myon          ↵
           │       │          │            │            │            │                 │ myon=CTc/myon
 template1 │ myon  │ UTF8     │ de_DE.utf8 │ de_DE.utf8 │            │ libc            │ =c/myon          ↵
           │       │          │            │            │            │                 │ myon=CTc/myon
(3 rows)

(Even longer if the username is "postgres")

It also makes \l+ even harder to read when the most often only
relevant new column, the database size, is even more to the far right.

Couldn't that be a single "Locale" column, possibly extended by more
info in parentheses if the values differ?

 Locale
 de_DE.utf8
 de-x-icu-whatever
 de_DE.utf8 (Ctype: C.UTF-8)
 SQL_ASCII (ICU Locale: en-x-something)

Christoph





view thread (22+ messages)  latest in thread

Message-ID: <YjYYmsLr9mzqI4Jq@msg.df7cb.de>
Permalink:  ../YjYYmsLr9mzqI4Jq@msg.df7cb.de/
Also on:    postgresql.org/message-id/YjYYmsLr9mzqI4Jq@msg.df7cb.de

 · 

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-committers@postgresql.org
  Cc: myon@debian.org, peter@eisentraut.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Add option to use ICU as global locale provider
  In-Reply-To: <YjYYmsLr9mzqI4Jq@msg.df7cb.de>
  References: <E1nUnH5-0006aR-MX@gemulon.postgresql.org> <YjYYmsLr9mzqI4Jq@msg.df7cb.de>

* 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