Re: Collation & ctype method table, and extension hooks
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Andreas Karlsson <andreas@proxel.se>, pgsql-hackers@postgresql.org, Peter Eisentraut <peter@eisentraut.org>
Date: 2026-06-30T01:29:19Z
Lists: pgsql-hackers
On Wed, Jun 11, 2025 at 10:49:17PM -0700, Jeff Davis wrote: > Attached v16. > I plan to commit this soon after branching. > Subject: [PATCH v16 1/4] Control ctype behavior internally with a method > table. > > Previously, pattern matching and case mapping behavior branched based > on the provider. > > Refactor to use a method table, which is less error-prone and easier > to hook. This became refactor commit 5a38104. In a UTF8 database, the commit changed the behavior of: SELECT 'café' ILIKE 'caf_' COLLATE "C"; That query reports true in v18, false in v19. I've copied Claude's whole review for the commit to https://docs.google.com/document/d/19_xKpKUQlY5N51qbfXyipXs3rqIYEC3qk5oaUDJ48YA/edit?tab=t.0. Two of its other findings sound potentially important, but I didn't verify them. nm
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