Re: tiny step toward threading: reduce dependence on setlocale()

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: tiny step toward threading: reduce dependence on setlocale()
Date: 2024-07-27 19:03:20
Message-ID: ece40520-ca74-4b22-8463-f48215854511@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Koshakow 2024-07-27 19:18:00 Fix overflow in pg_size_pretty
Previous Message Aditya Gupta 2024-07-27 16:58:14 Unexpected Null Pointer For Static Shared Memory Segment