Re: Collation version tracking for macOS - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Collation version tracking for macOS
Date
Msg-id CA+hUKGLRKKd2knzx-Y=-M6acogqZZ=LwdPUwWo007or3np7wyQ@mail.gmail.com
Whole thread Raw
In response to Re: Collation version tracking for macOS  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Collation version tracking for macOS
List pgsql-hackers
On Wed, Nov 30, 2022 at 8:03 AM Jeff Davis <pgsql@j-davis.com> wrote:
> On Wed, 2022-11-30 at 07:18 +1300, Thomas Munro wrote:
> > I think it also includes the CLDR version for *some* locales.  From a
> > quick look, that includes 'ar', 'ru', 'tr', 'zh'.  Jeff, would you
> > mind sharing the same table for one of those?  Perhaps 'en' really
> > does depend only on the UCA?
>
> =# select * from pg_icu_collation_versions('ar') order by icu_version;
>  icu_version | uca_version | collator_version
> -------------+-------------+------------------
>  50.2        | 6.2         | 58.0.0.50
>  51.3        | 6.2         | 58.0.0.50
>  52.2        | 6.2         | 58.0.0.50
>  53.2        | 6.3         | 137.51.25
>  54.2        | 7.0         | 137.56.26
>  55.2        | 7.0         | 153.56.27.1
>  56.2        | 8.0         | 153.64.28
>  57.2        | 8.0         | 153.64.29
>  58.3        | 9.0         | 153.72.30.3
>  59.2        | 9.0         | 153.72.31.1
>  60.3        | 10.0        | 153.80.32.1
>  61.2        | 10.0        | 153.80.33
>  62.2        | 11.0        | 153.88.33.8
>  63.2        | 11.0        | 153.88.34
>  64.2        | 12.1        | 153.97.35.8
>  65.1        | 12.1        | 153.97.36
>  66.1        | 13.0        | 153.14.36.8
>  67.1        | 13.0        | 153.14.37
>  68.2        | 13.0        | 153.14.38.8
>  69.1        | 13.0        | 153.14.39
>  70.1        | 14.0        | 153.112.40
> (21 rows)

Thanks.  So now we can see that the CLDR minor version is there too.
At a guess, in ICU 60 and before, it was the 4th component directly,
and from ICU 61 on, it's shifted left 3 bits.  I guess that means
those CLDR-dependent locales have higher frequency collversion
changes, including everyday "apt-get upgrade" (no major OS upgrade
required), assuming that Debian et al take those minor upgrades, while
others like 'en' should be stable for the whole ICU major version's
lifetime, and even across some ICU major version upgrades, because the
Unicode/UCA version changes more slowly.

Those CLDR-dependent locales therefore present us with a problem: as
discussed a while back, it's impossible to install two minor versions
of the same ICU major version with packages, and as Jeff has pointed
out in recent emails, even if you compile them yourself (which no one
really expects users to do), it doesn't really work because the
SONAMEs only have the major version, so the various libraries
that make up ICU will not be able to open each other correctly
(they'll follow symlinks to an arbitrary minor version).  (These two
things are not unrelated.)  So I probably need to remove the code that
claimed to support minor version addressing and go back to the
previous thinking that major will have to be enough.

In terms of user experience, I think that might mean that users of
'zh' who encounter warnings after a minor upgrade would therefore
really only have the options of REFRESHing and rebuilding, or
downgrading the package, because there's no way for us to access the
older version.  Users of 'en' probably only encounter collversion
changes when moving between OS releases with an ICU major version
change, and then the various schemes in this thread can help them
avoid the need to rebuild, until they eventually want to, if ever.



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Collation version tracking for macOS
Next
From: Robert Haas
Date:
Subject: Re: Collation version tracking for macOS