Re: Collation & ctype method table, and extension hooks

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Collation & ctype method table, and extension hooks
Date: 2024-12-02 15:39:11
Message-ID: 4548a168-62cd-457b-8d06-9ba7b985c477@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have not looked at the later patches in the series yet as I got
sidetracked while reviewing and decided to clean up some related
collation things which I added to the patch set (feel free to ignore
them if you want). The goal of my added patches is to move provider
specific code into fewer places and not have provider specific logic all
over the codebase.

I feel your first patch in the series is something you can just commit.
It looks good and is simple, obvious refactoring. In theory we could
share the code which does the lookup in the catalog table but I do not
think it would be worth it. I fixed a small issue with it and the
function prototypes in pg_collation.c.

I will look at the rest of your patches later.

My patches:

= v9-0002-Move-check-for-ucol_strcollUTF8-to-pg_locale_icu..patch

Broken out from v9-0010-Don-t-include-ICU-headers-in-pg_locale.h.patch.

= v9-0003-Move-code-for-collation-version-into-provider-spe.patch

Moves some code from pg_collate.c into provider specific files.

= v9-0004-Move-ICU-database-encoding-check-into-validation-.patch

Makes the ICU code more similar to the built-in provider plus reduces
some code duplication. I feel we could go one step further and also only
normalize built-in when "if (!IsBinaryUpgrade && dblocale !=
src_locale)" but I leave that for another patch if that is something we
actually want to unify.

= v9-0005-Move-provider-specific-code-when-looking-up-local.patch

I did not like how namespace.c had knowledge of ICU.

Andreas

Attachment Content-Type Size
v9-0001-Perform-provider-specific-initialization-code-in-.patch text/x-patch 18.6 KB
v9-0002-Move-check-for-ucol_strcollUTF8-to-pg_locale_icu..patch text/x-patch 1.8 KB
v9-0003-Move-code-for-collation-version-into-provider-spe.patch text/x-patch 10.8 KB
v9-0004-Move-ICU-database-encoding-check-into-validation-.patch text/x-patch 4.6 KB
v9-0005-Move-provider-specific-code-when-looking-up-local.patch text/x-patch 2.6 KB
v9-0006-Control-collation-behavior-with-a-method-table.patch text/x-patch 19.1 KB
v9-0007-Control-ctype-behavior-internally-with-a-method-t.patch text/x-patch 63.4 KB
v9-0008-Remove-provider-field-from-pg_locale_t.patch text/x-patch 4.8 KB
v9-0009-Make-provider-data-in-pg_locale_t-an-opaque-point.patch text/x-patch 21.6 KB
v9-0010-Don-t-include-ICU-headers-in-pg_locale.h.patch text/x-patch 2.8 KB
v9-0011-Introduce-hooks-for-creating-custom-pg_locale_t.patch text/x-patch 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2024-12-02 16:07:38 Re: Incorrect result of bitmap heap scan.
Previous Message Tom Turelinckx 2024-12-02 15:25:56 Re: RISC-V animals sporadically produce weird memory-related failures