Re: Collation & ctype method table, and extension hooks
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Andreas Karlsson <andreas@proxel.se>, pgsql-hackers@postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-02-07T19:19:21Z
Lists: pgsql-hackers
Attachments
- v15-0001-Control-ctype-behavior-internally-with-a-method-.patch (text/x-patch) patch v15-0001
- v15-0002-Remove-provider-field-from-pg_locale_t.patch (text/x-patch) patch v15-0002
- v15-0003-Make-provider-data-in-pg_locale_t-an-opaque-poin.patch (text/x-patch) patch v15-0003
- v15-0004-Don-t-include-ICU-headers-in-pg_locale.h.patch (text/x-patch) patch v15-0004
> I'm still inlined to think the method table is a good thing to do: > > (a) The performance cases I tried seem implausibly bad -- running > character classification patterns over large fields consisting only > of > codepoints over U+07FF. > > (b) The method tables seem like a better code organization that > separates the responsibilities of the provider from the calling code. > It's also a requirement (or nearly so) if we want to provide some > pluggability or support multiple library versions. > > It would be good to hear from others on these points, though. Attached v15. Just a rebase. I'd still like some input here. We could either: * commit this on the grounds that it's a desirable code improvement and the worst-case regression isn't a major concern; or * wait until v19 when we might have a more compelling use for the method table (e.g. pluggable provider or multilib) Regards, Jeff Davis
Commits
-
Remove provider field from pg_locale_t.
- 8af0d0ab01b4 19 (unreleased) landed
-
Control ctype behavior internally with a method table.
- 5a38104b3642 19 (unreleased) landed
-
Control collation behavior with a method table.
- a2f17f004d22 18.0 landed
-
Move code for collation version into provider-specific files.
- 4f5cef2607c1 18.0 landed
-
Refactor string case conversion into provider-specific files.
- 86a5d6006aff 18.0 landed
-
Move check for ucol_strcollUTF8 to pg_locale_icu.c
- 7167e05fc7d1 18.0 landed
-
Perform provider-specific initialization in new functions.
- 1ba0782ce90c 18.0 landed
-
Refactor the code to create a pg_locale_t into new function.
- 3aa2373c1141 18.0 landed