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

From Peter Eisentraut
Subject Re: tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id de1f1788-93bb-45cc-bef8-6f27119b2f3e@eisentraut.org
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Andreas Karlsson <andreas@proxel.se>)
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List pgsql-hackers
On 27.07.24 21:03, Andreas Karlsson wrote:
> On 7/26/24 10:35 PM, Jeff Davis wrote:
>> database_ctype_is_c refers to the LC_CTYPE environment of the database
>> -- pg_database.datctype. default_locale.ctype_is_c is the ctype of the
>> database's default collation.
>>
>> Confusing, I know, but it matters for a few things that still depend on
>> the LC_CTYPE, such as tsearch and maybe a few extensions. See
>> f413941f41.
> 
> Ah, right! That was thinko on my behalf.
> 
> The set of patches looks good to me now. There is further refactoring 
> that can be done in this area (and should be done given all calls e.g to 
> isalpha()) but I think this set of patches improves code readability 
> while moving us away from setlocale().
> 
> And even if we take a tiny performance hit here, which your tests did 
> not measure, I would say it is worth it both due to code clarity and due 
> to not relying on thread unsafe state.
> 
> I do not see these patches in the commitfest app but if they were I 
> would have marked them as ready for committer.

Here: https://commitfest.postgresql.org/48/5023/

I have also re-reviewed the patches and I agree they are good to go.




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Detach shared memory in Postmaster child if not needed
Next
From: Andres Freund
Date:
Subject: Suboptimal spinlock code due to volatile