pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix global ICU collations for ICU < 54
Date: Sun, 20 Mar 2022 09:36:52 +0000
Message-ID: <E1nVrzX-000Xxn-OQ@gemulon.postgresql.org> (raw)

Fix global ICU collations for ICU < 54

createdb() didn't check for collation attributes validity, which has
to be done explicitly on ICU < 54.  It also forgot to close the ICU collator
opened during the check which leaks some memory.

To fix both, add a new check_icu_locale() that does all the appropriate
verification and close the ICU collator.

initdb also had some partial check for ICU < 54.  To have consistent error
reporting across major ICU versions, and get rid of the need to include ucol.h,
remove the partial check there.  The backend will report an error if needed
during the post-boostrap iniitialization phase.

Author: Julien Rouhaud <julien.rouhaud@free.fr>
Discussion: https://www.postgresql.org/message-id/20220319041459.qqqiqh335sga5ezj@jrouhaud

Branch
------
master

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

Modified Files
--------------
src/backend/commands/dbcommands.c | 18 +-----------------
src/backend/utils/adt/pg_locale.c | 28 ++++++++++++++++++++++++++++
src/bin/initdb/Makefile           |  2 +-
src/bin/initdb/initdb.c           | 22 +++-------------------
src/bin/initdb/t/001_initdb.pl    |  2 +-
src/include/utils/pg_locale.h     |  1 +
src/test/icu/t/010_database.pl    |  4 ++--
7 files changed, 37 insertions(+), 40 deletions(-)



Message-ID: <E1nVrzX-000Xxn-OQ@gemulon.postgresql.org>
Permalink:  ../E1nVrzX-000Xxn-OQ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nVrzX-000Xxn-OQ@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Fix global ICU collations for ICU < 54
  In-Reply-To: <E1nVrzX-000Xxn-OQ@gemulon.postgresql.org>
  References: <E1nVrzX-000Xxn-OQ@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