From: Tristan Partin <tristan@partin.io>
To: Jeff Davis <pgsql@j-davis.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Remaining dependency on setlocale()
Date: Fri, 09 Aug 2024 15:16:58 -0500
Message-ID: <D3BNOV3TA7KU.2LD03GA9Q4OZV@partin.io> (raw)
In-Reply-To: <4c5da86af36a0d5e430eee3f60ce5e06f1b5cd34.camel@j-davis.com>
References: <4c5da86af36a0d5e430eee3f60ce5e06f1b5cd34.camel@j-davis.com>
On Tue Aug 6, 2024 at 5:00 PM CDT, Jeff Davis wrote:
> After some previous work here:
>
> https://postgr.es/m/89475ee5487d795124f4e25118ea8f1853edb8cb.camel@j-davis.com
>
> we are less dependent on setlocale(), but it's still not completely
> gone.
>
> setlocale() counts as thread-unsafe, so it would be nice to eliminate
> it completely.
>
> The obvious answer is uselocale(), which sets the locale only for the
> calling thread, and takes precedence over whatever is set with
> setlocale().
>
> But there are a couple problems:
>
> 1. I don't think it's supported on Windows.
>
> 2. I don't see a good way to canonicalize a locale name, like in
> check_locale(), which uses the result of setlocale().
>
> Thoughts?
Hey Jeff,
See this thread[0] for some work that I had previously done. Feel free
to take it over, or we could collaborate.
[0]: https://www.postgresql.org/message-id/CWMW5OZBWJ10.1YFLQWSUE5RE9@neon.tech
--
Tristan Partin
Neon (https://neon.tech)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tristan@partin.io, pgsql@j-davis.com
Subject: Re: Remaining dependency on setlocale()
In-Reply-To: <D3BNOV3TA7KU.2LD03GA9Q4OZV@partin.io>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox