Re: Remaining dependency on setlocale() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remaining dependency on setlocale()
Date
Msg-id 1841102.1722982989@sss.pgh.pa.us
Whole thread Raw
In response to Remaining dependency on setlocale()  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Remaining dependency on setlocale()
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> But there are a couple problems:

> 1. I don't think it's supported on Windows.

Can't help with that, but surely Windows has some thread-safe way.

> 2. I don't see a good way to canonicalize a locale name, like in
> check_locale(), which uses the result of setlocale().

What I can tell you about that is that check_locale's expectation
that setlocale does any useful canonicalization is mostly wishful
thinking [1].  On a lot of platforms you just get the input string
back again.  If that's the only thing keeping us on setlocale,
I think we could drop it.  (Perhaps we should do some canonicalization
of our own instead?)

            regards, tom lane

[1] https://www.postgresql.org/message-id/14856.1348497531@sss.pgh.pa.us



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Minor refactorings to eliminate some static buffers
Next
From: Melih Mutlu
Date:
Subject: Re: Vectored IO in XLogWrite()