From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tristan Partin <tristan(at)neon(dot)tech>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: On non-Windows, hard depend on uselocale(3) |
Date: | 2023-11-15 19:16:31 |
Message-ID: | CA+hUKGLcCp-siKenOPPXdx_yT6fhenWNH1xaL-QPkqf=xnK=Fg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Nov 16, 2023 at 7:42 AM Dagfinn Ilmari Mannsåker
<ilmari(at)ilmari(dot)org> wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > "Tristan Partin" <tristan(at)neon(dot)tech> writes:
> >> I would like to propose removing HAVE_USELOCALE, and just have WIN32,
> >> which means that Postgres would require uselocale(3) on anything that
> >> isn't WIN32.
> >
> > You would need to do some research and try to prove that that won't
> > be a problem on any modern platform. Presumably it once was a problem,
> > or we'd not have bothered with a configure check.
> >
> > (Some git archaeology might yield useful info about when and why
> > we added the check.)
>
> For reference, the Perl effort to use the POSIX.1-2008 thread-safe
> locale APIs have revealed several platform-specific bugs that cause it
> to disable them on FreeBSD and macOS:
>
> https://github.com/perl/perl5/commit/9cbc12c368981c56d4d8e40cc9417ac26bec2c35
Interesting that C vs C.UTF-8 has come up there, something that has
also confused us and others (in fact I still owe Daniel Vérité a
response to his complaint about how we treat the latter; I got stuck
on a logical problem with the proposal and then dumped core...). The
idea of C.UTF-8 is relatively new, and seems to have shaken a few bugs
out in a few places. Anyway, that in particular is a brand new
FreeBSD bug report and I am sure it will be addressed soon.
> https://github.com/perl/perl5/commit/dd4eb78c55aab441aec1639b1dd49f88bd960831
As for macOS, one thing I noticed is that the FreeBSD -> macOS
pipeline appears to have re-awoken after many years of slumber. I
don't know anything about that other than that when I recently
upgraded my Mac to 14.1, suddenly a few userspace tools are now
running the recentish FreeBSD versions of certain userland tools (tar,
grep, ...?), instead of something from the Jurassic. Whether that
might apply to libc, who can say... they seemed to have quite ancient
BSD locale code last time I checked.
> https://github.com/perl/perl5/commit/0f3830f3997cf7ef1531bad26d2e0f13220dd862
That linked issue appears to be fixed already.
> But Perl actually makes use of per-thread locales, because it has a
> separate interpereer per thread, each of which can have a different
> locale active. Since Postgres isn't actually multi-threaded (yet),
> these concerns might not apply to the same degree.
ECPG might use them in multi-threaded code. I'm not sure if it's a
problem and whose problem it is.
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2023-11-15 19:45:14 | Re: retire MemoryContextResetAndDeleteChildren backwards compatibility macro |
Previous Message | Jeff Davis | 2023-11-15 19:09:11 | Re: Why do indexes and sorts use the database collation? |