Re: ICU fixed digit reordering bug

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ICU fixed digit reordering bug
Date: 2026-10-27 20:35:46
Message-ID: 34af5fca350571fc0c762b811377738712d9eca3.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2026-10-27 at 20:50 +0100, Peter Eisentraut wrote:
> There have been various reports over time that ICU collations that
> reorder digits are buggy. These are collations defined like
>
> CREATE COLLATION digitslast (provider = icu, locale = 'en-u-kr-latn-digit');
>
> (which means, move digits after Latin letters).
>
> This issue was reported upstream to ICU:
>
> https://unicode-org.atlassian.net/browse/ICU-23016
>
> This issue was finally fixed in ICU 79, which came out a few days ago.
> I have confirmed that the PostgreSQL issue is fixed with that new version.
>
> The question now is whether there is anything else we want to do about this?
>
> Here are some things we could do:
>
> 0. Do nothing. Leave the ICU bug and possibly this email as reference
> and recommend that users don't use the affected kinds of ICU locales
> with the affected older ICU versions.
>
> 1. We could check when a ICU collator object is created
> (create_pg_locale_icu()) whether the locale contains digits reordering
> and error out if an affected older ICU version is used.
>
> 1.a) The same but only for future PostgreSQL versions (no backpatch).
>
> [...]
>
> The last two are probably too much effort to make something work that
> never worked to begin with. But I think it's worth contemplating
> whether we want to do item 1, check explicitly for this bug and prevent
> users running into it by accident. This is feasible now that we know
> the precise cause and fix.

Option 1 is appealing, but it would prevent upgrading a database with
such a collation. That wouldn't be good.

Perhaps a warning would be good enough?

Yours,
Laurenz Albe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-10-27 20:59:50 Re: Fix BRIN numeric_minmax_multi_ops out of range value range merging
Previous Message David Christensen 2026-10-27 20:22:47 Re: [PATCH] GROUP BY ALL: the regroupening