Validate ICU locales.
Jeff Davis <jdavis@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +26 −0 |
| src/backend/commands/collationcmds.c | modified | +2 −0 |
| src/backend/commands/dbcommands.c | modified | +1 −1 |
| src/backend/utils/adt/pg_locale.c | modified | +63 −7 |
| src/backend/utils/misc/guc_tables.c | modified | +26 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +3 −0 |
| src/bin/initdb/initdb.c | modified | +56 −2 |
| src/bin/initdb/t/001_initdb.pl | modified | +18 −0 |
| src/include/utils/pg_locale.h | modified | +3 −1 |
| src/test/regress/expected/collate.icu.utf8.out | modified | +8 −1 |
| src/test/regress/sql/collate.icu.utf8.sql | modified | +4 −1 |
Documentation touched
Discussion
- ICU 54 and earlier are too dangerous 6 messages · 2023-03-13 → 2023-03-17
- ICU locale validation / canonicalization 46 messages · 2023-02-08 → 2023-07-07