Re: Collation version tracking for macOS

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Jeremy Schneider <schneider(at)ardentperf(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, "Nasby, Jim" <nasbyj(at)amazon(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Collation version tracking for macOS
Date: 2022-11-26 05:27:05
Message-ID: CA+hUKGLr=9d+-k8PVv8e__TOxuq=n0SKNDpqCzbGrK5EbDyxAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 24, 2022 at 5:48 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> On Thu, Nov 24, 2022 at 3:07 PM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> > I'd vote for 1 on the grounds that it's easier to document and
> > understand a single collation version, which comes straight from
> > ucol_getVersion(). This approach makes it a separate problem to find
> > the collation version among whatever libraries the admin can provide;
> > but adding some observability into the search should mitigate any
> > confusion.
>
> OK, it sounds like I should code that up next.

Here's the first iteration. The version rosetta stone functions look like this:

postgres=# select * from pg_icu_library_versions();
icu_version | unicode_version | cldr_version
-------------+-----------------+--------------
67.1 | 13.0 | 37.0
63.1 | 11.0 | 34.0
57.1 | 8.0 | 29.0
(3 rows)

postgres=# select * from pg_icu_collation_versions('zh');
icu_version | uca_version | collator_version
-------------+-------------+------------------
67.1 | 13.0 | 153.14.37
63.1 | 11.0 | 153.88.34
57.1 | 8.0 | 153.64.29
(3 rows)

It's no longer necessary to put anything in PG_TEST_EXTRA to run
"meson test irc/020_multiversion" usefully. It will find extra ICU
versions all by itself in your system library search path and SKIP if
it doesn't find a second major version. I have tried to cover the
main scenarios that I expect users to encounter in the update TAP
tests, with commentary that I hope will be helpful to assess the
usability of this thing.

Other changes:

* now using RTLD_LOCAL instead of RTLD_GLOBAL (I guess the latter
might cause trouble for someone using --disable-renaming, but I
haven't tested that and am not an expert on linker/loader arcana)
* fixed library names on Windows (based on reading the manual, but I
haven't tested that)
* fixed failure on non-ICU builds (the reason CI was failing in v7,
some misplaced #ifdefs)
* various cleanup
* I've attached a throwaway patch to install a second ICU version on
Debian/amd64 on CI, since otherwise the new test would SKIP on all
systems

This is just a first cut, but enough to try out and see if we like it,
what needs to be improved, what edge cases we haven't thought about
etc. Let me know what you think.

Attachment Content-Type Size
v8-0001-WIP-Multi-version-ICU.patch text/x-patch 66.3 KB
v8-0002-ci-XXX-install-ICU63-on-debian.patch text/x-patch 929 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2022-11-26 05:28:55 Re: Avoid streaming the transaction which are skipped (in corner cases)
Previous Message David G. Johnston 2022-11-26 03:43:38 Re: [DOCS] Stats views and functions not in order?