Re: check_strxfrm_bug() - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: check_strxfrm_bug()
Date
Msg-id 726eece8-6e9d-9013-0e4a-a1f9e40c09b3@iki.fi
Whole thread Raw
In response to Re: check_strxfrm_bug()  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: check_strxfrm_bug()
List pgsql-hackers
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)




pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Remove WindowClause PARTITION BY items belonging to redundant pathkeys
Next
From: "Fujii.Yuki@df.MitsubishiElectric.co.jp"
Date:
Subject: RE: Partial aggregates pushdown