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

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add option to use ICU as global locale provider
Date: 2022-03-18 09:27:49
Message-ID: 20220318092749.363m4uv6rq24lctz@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

(moving to -hackers)

On Fri, Mar 18, 2022 at 03:40:51PM +0800, Julien Rouhaud wrote:
> On Fri, Mar 18, 2022 at 02:36:48PM +0800, Julien Rouhaud wrote:
> > On Fri, Mar 18, 2022 at 06:15:47PM +1300, Thomas Munro wrote:
> > >
> > > No idea what's happening here but one observation is that that animal
> > > is running an older distro that shipped with ICU 5.0. Commit b8f9a2a6
> > > may hold a clue...
> >
> > Right. I'm setting up a similar podman environment, hopefully more info soon.
>
> And indeed b8f9a2a6 is the problem. We would need some form of
> icu_set_collation_attributes() on the frontend side if we want to detect such a
> problem on older ICU version at the expected moment rather than when
> bootstrapping the info. A similar check is also needed in createdb().

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.

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-03-18 15:07:04 Re: pgsql: Add option to use ICU as global locale provider
Previous Message Julien Rouhaud 2022-03-18 07:40:51 Re: pgsql: Add option to use ICU as global locale provider

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2022-03-18 10:17:00 Re: Tab completion for SET TimeZone
Previous Message Kyotaro Horiguchi 2022-03-18 09:18:07 Re: Replication slot drop message is sent after pgstats shutdown.