Re: pgsql: Add option to use ICU as global locale provider

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Julien Rouhaud <rjuju123@gmail.com>, Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, pgsql-hackers@lists.postgresql.org
Date: 2022-03-18T19:28:58Z
Lists: pgsql-hackers
On 18.03.22 10:27, Julien Rouhaud wrote:
> I'm attaching a patch that fixes both issues for me with ICU 50.  Note that
> there's already a test that would have failed for CREATE DATABASE if initdb
> tests didn't fail first, so no new test needed.
> 
> I ended up copy/pasting icu_set_collation_attributes() in initdb.c.  There
> shouldn't be new attributes added in old ICU versions, and there are enough
> differences to make it work in the frontend that it didn't seems worth to have
> a single function.

Another option is that we just don't do the check in initdb.  As the 
tests show, you will then get an error from the backend call, so it's 
really just a question of when the error is reported.

Why does your patch introduce a function check_icu_locale() that is only 
called once?  Did you have further plans for that?



Commits

  1. psql: fix \l display for pre-v15 databases.

  2. Fix global ICU collations for ICU < 54

  3. Add option to use ICU as global locale provider

  4. Add support for collation attributes on older ICU versions