Re: [18] Fix a few issues with the collation cache

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: pgsql-hackers@postgresql.org
Date: 2024-08-14T23:30:23Z
Lists: pgsql-hackers

Attachments

On Thu, 2024-08-08 at 12:24 -0700, Jeff Davis wrote:
> The collation cache, which maps collation oids to pg_locale_t
> objects,
> has a few longstanding issues:

Here's a patch set v2.

I changed it so that the pg_locale_t itself a resource kind, rather
than having separate locale_t and UCollator resource kinds. That
requires a bit more care to make sure that the pg_locale_t can be
initialized without leaking the locale_t or UCollator, but worked out
to be simpler overall.

A potential benefit of these changes is that, for eventual support of
multi-lib or an extension hook, improvements in the API here will make
things less error-prone.

Regards,
	Jeff Davis

Commits

  1. Tighten up make_libc_collator() and make_icu_collator().