Thread
-
Re: Remaining dependency on setlocale()
Jeff Davis <pgsql@j-davis.com> — 2025-11-12T18:59:35Z
On Wed, 2025-11-12 at 19:41 +0100, Peter Eisentraut wrote: > The impact area of LC_CTYPE is much larger and more complicated > and possibly interacts with other settings and third-party libraries > in > ways that we don't understand yet and might not be able to change. > That's why I'm more hesitant about it. What do you think about making lc_ctype and/or lc_collate into GUCs (like lc_messages), assuming we remove all known effects in the backend first? If we make the setting PGC_POSTMASTER, then it eliminates potential problems with threading, because setlocale() would be called only once before allowing connections. For platforms that support uselocale(), we could allow it to be set more freely, for those who need it set to different values in different backends. It would also be easier to document, which would be nice. There could be some confusion if various settings are inconsistent with each other, but that's true currently. And we'd still enforce a ctype that's consistent with the encoding, at least. Regards, Jeff Davis