pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add option to use ICU as global locale provider
Date: Thu, 17 Mar 2022 10:22:32 +0000
Message-ID: <E1nUnH5-0006aR-MX@gemulon.postgresql.org> (raw)

Add option to use ICU as global locale provider

This adds the option to use ICU as the default locale provider for
either the whole cluster or a database.  New options for initdb,
createdb, and CREATE DATABASE are used to select this.

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.

Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/5e756dd6-0e91-d778-96fd-b1bcb06c161a%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f2553d43060edb210b36c63187d52a632448e1d2

Modified Files
--------------
doc/src/sgml/catalogs.sgml                     |   9 ++
doc/src/sgml/charset.sgml                      | 102 ++++++++++++++++
doc/src/sgml/ref/create_database.sgml          |  32 +++++
doc/src/sgml/ref/createdb.sgml                 |  19 +++
doc/src/sgml/ref/initdb.sgml                   |  72 +++++++++---
src/backend/catalog/pg_collation.c             |  18 ++-
src/backend/commands/collationcmds.c           |  97 +++++++++------
src/backend/commands/dbcommands.c              | 157 +++++++++++++++++++++----
src/backend/utils/adt/pg_locale.c              | 144 ++++++++++++++---------
src/backend/utils/init/postinit.c              |  21 +++-
src/bin/initdb/Makefile                        |   4 +-
src/bin/initdb/initdb.c                        |  97 +++++++++++++--
src/bin/initdb/t/001_initdb.pl                 |  27 +++++
src/bin/pg_dump/pg_dump.c                      |  30 ++++-
src/bin/pg_upgrade/check.c                     |  13 ++
src/bin/pg_upgrade/info.c                      |  18 ++-
src/bin/pg_upgrade/pg_upgrade.h                |   2 +
src/bin/psql/describe.c                        |  23 +++-
src/bin/psql/tab-complete.c                    |   3 +-
src/bin/scripts/Makefile                       |   2 +
src/bin/scripts/createdb.c                     |  20 ++++
src/bin/scripts/t/020_createdb.pl              |  28 +++++
src/include/catalog/catversion.h               |   2 +-
src/include/catalog/pg_collation.dat           |   3 +-
src/include/catalog/pg_collation.h             |  20 +++-
src/include/catalog/pg_database.dat            |   4 +-
src/include/catalog/pg_database.h              |   6 +
src/include/utils/pg_locale.h                  |   5 +
src/test/Makefile                              |   6 +-
src/test/icu/.gitignore                        |   2 +
src/test/icu/Makefile                          |  25 ++++
src/test/icu/README                            |  27 +++++
src/test/icu/t/010_database.pl                 |  58 +++++++++
src/test/regress/expected/collate.icu.utf8.out |  10 +-
src/test/regress/sql/collate.icu.utf8.sql      |   8 +-
35 files changed, 947 insertions(+), 167 deletions(-)



view thread (22+ messages)  latest in thread

Message-ID: <E1nUnH5-0006aR-MX@gemulon.postgresql.org>
Permalink:  ../E1nUnH5-0006aR-MX@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nUnH5-0006aR-MX@gemulon.postgresql.org

 · 

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: peter@eisentraut.org
  Subject: Re: pgsql: Add option to use ICU as global locale provider
  In-Reply-To: <E1nUnH5-0006aR-MX@gemulon.postgresql.org>
  References: <E1nUnH5-0006aR-MX@gemulon.postgresql.org>

* 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