pgsql: Handle the "und" locale in ICU versions 54 and older. - Mailing list pgsql-committers

From Jeff Davis
Subject pgsql: Handle the "und" locale in ICU versions 54 and older.
Date
Msg-id E1pfORi-005115-Gc@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Handle the "und" locale in ICU versions 54 and older.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
Handle the "und" locale in ICU versions 54 and older.

The "und" locale is an alternative spelling of the root locale, but it
was not recognized until ICU 55. To maintain common behavior across
all supported ICU versions, check for "und" and replace with "root"
before opening.

Previously, the lack of support for "und" was dangerous, because
versions 54 and older fall back to the environment when a locale is
not found. If the user specified "und" for the language (which is
expected and documented), it could not only resolve to the wrong
collator, but it could unexpectedly change (which could lead to
corrupt indexes).

This effectively reverts commit d72900bded, which worked around the
problem for the built-in "unicode" collation, and is no longer
necessary.

Discussion: https://postgr.es/m/60da0cecfb512a78b8666b31631a636215d8ce73.camel@j-davis.com
Discussion: https://postgr.es/m/0c6fa66f2753217d2a40480a96bd2ccf023536a1.camel@j-davis.com
Reviewed-by: Peter Eisentraut

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3b50275b12950280fb07193e24a4f400ed8a9fef

Modified Files
--------------
src/backend/utils/adt/pg_locale.c              | 34 ++++++++++++++++++++++++++
src/bin/initdb/initdb.c                        |  2 +-
src/test/regress/expected/collate.icu.utf8.out |  7 ++++++
src/test/regress/sql/collate.icu.utf8.sql      |  2 ++
4 files changed, 44 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: amcheck: Fix a few bugs in new update chain validation.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Handle the "und" locale in ICU versions 54 and older.