pgsql: Validate ICU locales.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Validate ICU locales.
Date: 2023-03-28 23:35:18
Message-ID: E1phIqT-000EIX-Is@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Validate ICU locales.

For ICU collations, ensure that the locale's language exists in ICU,
and that the locale can be opened.

Basic validation helps avoid minor mistakes and misspellings, which
often fall back to the root locale instead of the intended
locale. It's even more important to avoid such mistakes in ICU
versions 54 and earlier, where the same (misspelled) locale string
could fall back to different locales depending on the environment.

Discussion: https://postgr.es/m/11b1eeb7e7667fdd4178497aeb796c48d26e69b9.camel@j-davis.com
Discussion: https://postgr.es/m/df2efad0cae7c65180df8e5ebb709e5eb4f2a82b.camel@j-davis.com
Reviewed-by: Peter Eisentraut

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1671f990dd669c0b72e45c7bef0fd579a10676ed

Modified Files
--------------
doc/src/sgml/config.sgml | 26 ++++++++++
src/backend/commands/collationcmds.c | 2 +
src/backend/commands/dbcommands.c | 2 +-
src/backend/utils/adt/pg_locale.c | 70 +++++++++++++++++++++++---
src/backend/utils/misc/guc_tables.c | 26 ++++++++++
src/backend/utils/misc/postgresql.conf.sample | 3 ++
src/bin/initdb/initdb.c | 58 ++++++++++++++++++++-
src/bin/initdb/t/001_initdb.pl | 18 +++++++
src/include/utils/pg_locale.h | 4 +-
src/test/regress/expected/collate.icu.utf8.out | 9 +++-
src/test/regress/sql/collate.icu.utf8.sql | 5 +-
11 files changed, 210 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2023-03-29 00:37:14 pgsql: pg_dump: Fix gzip compression of empty data
Previous Message Robert Haas 2023-03-28 20:28:23 Re: pgsql: amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.