On 12/06/2023 01:15, Thomas Munro wrote:
There are still at least a couple
of functions that lack XXX_l variants in the standard: mbstowcs() and
wcstombs() (though we use the non-standard _l variants if we find them
in <xlocale.h>), but that's OK because we use uselocale() and not
setlocale(), because uselocale() is required to be thread-local.

Right, mbstowcs() and wcstombs() are already thread-safe, that's why there are no _l variants of them.

The use of setlocale() to set up the per-backend/per-database
default locale would have to be replaced with uselocale().
This recent bug report is also related to that: https://www.postgresql.org/message-id/17946-3e84cb577e9551c3%40postgresql.org. In a nutshell, libperl calls uselocale(), which overrides the setting we try set with setlocale().

--
Heikki Linnakangas
Neon (https://neon.tech)



Reply via email to