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/[email protected]
Discussion: 
https://postgr.es/m/[email protected]
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(-)

Reply via email to