tiny step toward threading: reduce dependence on setlocale() - Mailing list pgsql-hackers

From Jeff Davis
Subject tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id 2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.camel@j-davis.com
Whole thread Raw
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List pgsql-hackers
There was an unconference session at pgconf.dev related to threading
support. One of the problems identified was setlocale().

The attached series of patches make collation not depend on
setlocale(), even if the database collation uses the libc provider.

Since commit 8d9a9f034e, all supported platforms have locale_t, so we
can use strcoll_l(), etc., or uselocale() when no "_l" variant is
available.

A brief test shows that there may be a performance regression for libc
default collations. But if so, I'm not sure that's avoidable if the
goal is to take away setlocale. I'll see if removing the extra branches
mitigates it.


--
Jeff Davis
PostgreSQL Contributor Team - AWS



Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [multithreading] extension compatibility
Next
From: Michael Paquier
Date:
Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables