Re: tiny step toward threading: reduce dependence on setlocale() - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id 89475ee5487d795124f4e25118ea8f1853edb8cb.camel@j-davis.com
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List pgsql-hackers
On Mon, 2024-07-29 at 21:45 +0200, Peter Eisentraut wrote:
> I have also re-reviewed the patches and I agree they are good to go.

I found a couple issues with the later patches:

* There was still some confusion about the default collation vs.
datcollate/datctype for callers of wchar2char() and char2wchar() (those
functions only work for libc). I introduced a new pg_locale_t structure
to represent datcollate/datctype regardless of datlocprovider to solve
this.

* Another loose end relying on setlocale(): in selfuncs.c, there's
still a call directly to strxfrm(), which depends on setlocale(). I
changed this to lookup the collation and then use pg_strxfrm(). That
should improve histogram selectivity estimates because it uses the
correct provider, rather than relying on setlocale(), right?

New series attached.

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: remove volatile qualifiers from pg_stat_statements
Next
From: Heikki Linnakangas
Date:
Subject: Re: Minor refactorings to eliminate some static buffers