Re: Rework of collation code, extensibility - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Rework of collation code, extensibility
Date
Msg-id 858d8908e1123ffafb8176ece9aadc3888f5f2c2.camel@j-davis.com
Whole thread Raw
In response to Re: Rework of collation code, extensibility  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List 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





pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Weird failure with latches in curculio on v15
Next
From: Justin Pryzby
Date:
Subject: Re: pgsql: Refactor to add pg_strcoll(), pg_strxfrm(), and variants.