From: | "Tristan Partin" <tristan(at)partin(dot)io> |
---|---|
To: | "Jeff Davis" <pgsql(at)j-davis(dot)com> |
Cc: | "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Remaining dependency on setlocale() |
Date: | 2024-08-09 20:16:58 |
Message-ID: | D3BNOV3TA7KU.2LD03GA9Q4OZV@partin.io |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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)
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2024-08-09 20:30:21 | Re: is_superuser versus set_config_option's parallelism check |
Previous Message | Corey Huinker | 2024-08-09 20:06:16 | Re: optimizing pg_upgrade's once-in-each-database steps |