Re: Rework of collation code, extensibility
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-hackers@postgresql.org
Date: 2023-02-23T23:59:04Z
Lists: pgsql-hackers
On Wed, 2023-02-22 at 20:49 +0100, Peter Eisentraut wrote: > > On 14.02.23 00:45, Jeff Davis wrote: > > > > Now the patches are: > > > > > > > > 0001: pg_strcoll/pg_strxfrm > > > > 0002: pg_locale_deterministic() > > > > 0003: cleanup a USE_ICU special case > > > > 0004: GUCs (only for testing, not for commit) > > > > I haven't read the whole thing again, but this arrangement looks > > good > to > > me. I don't have an opinion on whether 0004 is actually useful. Committed with a few revisions after I took a fresh look over the patch. The most significant was that I found out that we are also hashing the NUL byte at the end of the string when the collation is non- deterministic. The refactoring patch doesn't change that of course, but the API from pg_strnxfrm() is more clear and I added comments. Also, ICU uses int32_t for string lengths rather than size_t (I'm not sure that's a great idea, but that's what ICU does). I clarified the boundary by changing the argument types of the ICU-specific static functions to int32_t, while leaving the API entry points as size_t. -- Jeff Davis PostgreSQL Contributor Team - AWS
Commits
-
Remove unnecessary #ifdef USE_ICU and branch.
- e0b3074e8944 16.0 landed
-
Refactor to introduce pg_locale_deterministic().
- 6974a8f7682b 16.0 landed
-
Refactor to add pg_strcoll(), pg_strxfrm(), and variants.
- d87d548cd030 16.0 landed
-
Fix MSVC build
- c971a5b27ac9 16.0 cited