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

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add option to use ICU as global locale provider
Date: 2022-03-19 04:14:59
Message-ID: 20220319041459.qqqiqh335sga5ezj@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Mar 18, 2022 at 03:09:59PM -0700, Andres Freund wrote:
> Hi,
>
> On 2022-03-18 20:28:58 +0100, Peter Eisentraut wrote:
> > Why does your patch introduce a function check_icu_locale() that is only
> > called once? Did you have further plans for that?
>
> I like that it moves ICU code out of dbcommands.c

Yes, it seemed cleaner this way. But more importantly code outside pg_locale.c
really shouldn't have to deal with ICU specific version code.

I'm attaching a v2, addressing Peter and Tom comments to not duplicate the old
ICU versions attribute function. I removed the ICU locale check entirely (for
consistency across ICU version) thus removing any need for ucol.h include in
initdb.

For the problem you reported at [1] with the meson branch, I changed createdb
tests with s/en-u-kf-upper/en(at)colCaseFirst=upper/, as older ICU versions don't
understand the former notation. check-world now pass for me, using either ICU
< 54 or >= 54.

> imo there should be few
> calls to ICU functions outside of pg_locale.c. There might be an argument for
> moving *more* into such a function though.

I think it would be a good improvement. I can work on that next week if
needed.

[1] https://www.postgresql.org/message-id/20220318000140.vzri3qw3p4aebn5p@alap3.anarazel.de

Attachment Content-Type Size
v2-0001-Fix-global-icu-collations-for-ICU-54.patch text/plain 5.8 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-03-19 07:39:11 pgsql: doc: Mention SET TABLESPACE clause for ALTER MATERIALIZED VIEW
Previous Message Amit Langote 2022-03-19 04:09:02 Re: pgsql: Split ExecUpdate and ExecDelete into reusable pieces

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2022-03-19 08:47:04 Re: Why is src/test/modules/committs/t/002_standby.pl flaky?
Previous Message Ajin Cherian 2022-03-19 03:40:34 Re: logical replication empty transactions