pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle the "und" locale in ICU versions 54 and older.
Date: Thu, 23 Mar 2023 17:09:50 +0000
Message-ID: <E1pfORi-005115-Gc@gemulon.postgresql.org> (raw)

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(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1pfORi-005115-Gc@gemulon.postgresql.org>
Permalink:  ../E1pfORi-005115-Gc@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pfORi-005115-Gc@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Handle the "und" locale in ICU versions 54 and older.
  In-Reply-To: <E1pfORi-005115-Gc@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