Re: Windows default locale vs initdb

2023-12-13 Thread Thomas Munro
Here is a thought that occurs to me, as I follow along with Jeff Davis's evolving proposals for built-in collations and ctypes: What would stop us from dropping support for the libc (sic) provider on Windows? That may sound radical and likely to cause extra work for people on upgrade, but how

Re: Windows default locale vs initdb

2023-11-19 Thread Thomas Munro
I clicked "Trigger" to get a Mingw test run of this, and it failed[1]. I see why: our function win32_langinfo() believes that it shouldn't call GetLocaleInfoEx() on non-MSVC compilers, so we see 'initdb: error: could not find suitable encoding for locale "en-US"'. I think it has fallback code

Re: Windows default locale vs initdb

2023-11-19 Thread Thomas Munro
Another country has changed its name, and a Windows OS update has again broken every PostgreSQL cluster in that whole country[1] (or at least those that had accepted initdb's default choice of locale, probably most). Let's get to the bottom of this, because otherwise it is simply going to keep

Re: Windows default locale vs initdb

2022-12-22 Thread Thomas Munro
On Fri, Jul 29, 2022 at 3:33 PM Thomas Munro wrote: > On Fri, Jul 22, 2022 at 11:59 PM Juan José Santamaría Flecha > wrote: > > TL;DR; What I want to show through this example is that Windows ACP is not > > modified by setlocale(), it can only be done through the Windows registry > > and only

Re: Windows default locale vs initdb

2022-07-28 Thread Thomas Munro
On Fri, Jul 22, 2022 at 11:59 PM Juan José Santamaría Flecha wrote: > TL;DR; What I want to show through this example is that Windows ACP is not > modified by setlocale(), it can only be done through the Windows registry and > only in recent releases. Thanks, that was helpful, and so was that

Re: Windows default locale vs initdb

2022-07-22 Thread Juan José Santamaría Flecha
On Wed, Jul 20, 2022 at 1:44 PM Thomas Munro wrote: > On Wed, Jul 20, 2022 at 10:27 PM Juan José Santamaría Flecha > wrote: > > Still, WIN1252 is not the wrong answer for what we are asking. Even if > you enable UTF-8 support [1], the system will use the current default > Windows ANSI code page

Re: Windows default locale vs initdb

2022-07-20 Thread Thomas Munro
On Wed, Jul 20, 2022 at 10:27 PM Juan José Santamaría Flecha wrote: > On Tue, Jul 19, 2022 at 4:47 AM Thomas Munro wrote: >> As for whether "accordingly" still applies, by the logic of of >> win32_langinfo()... Windows still considers WIN1252 to be the default >> ANSI code page for "en-US",

Re: Windows default locale vs initdb

2022-07-20 Thread Juan José Santamaría Flecha
On Tue, Jul 19, 2022 at 4:47 AM Thomas Munro wrote: > As for whether "accordingly" still applies, by the logic of of > win32_langinfo()... Windows still considers WIN1252 to be the default > ANSI code page for "en-US", though it'd work with UTF-8 too. I'm not > sure what to make of that. The

Re: Windows default locale vs initdb

2022-07-20 Thread Juan José Santamaría Flecha
On Tue, Jul 19, 2022 at 12:59 AM Thomas Munro wrote: > Now that museum-grade Windows has been defenestrated, we are free to > call GetUserDefaultLocaleName(). Here's a patch. > This LGTM. > > I think we should also convert to POSIX format when making the > collname in your

Re: Windows default locale vs initdb

2022-07-18 Thread Thomas Munro
On Tue, Jul 19, 2022 at 10:58 AM Thomas Munro wrote: > Here's a patch. I added this to the next commitfest, and cfbot promptly told me about some warnings I needed to fix. That'll teach me to post a patch tested with "ci-os-only: windows". Looking more closely at some error messages that

Re: Windows default locale vs initdb

2022-07-18 Thread Thomas Munro
On Wed, Dec 15, 2021 at 11:32 PM Juan José Santamaría Flecha wrote: > On Sun, May 16, 2021 at 6:29 AM Noah Misch wrote: >> On Mon, Apr 19, 2021 at 05:42:51PM +1200, Thomas Munro wrote: >> > The question we asked ourselves >> > multiple times in the other thread was how we're supposed to get to

Re: Windows default locale vs initdb

2021-12-15 Thread Juan José Santamaría Flecha
On Sun, May 16, 2021 at 6:29 AM Noah Misch wrote: > On Mon, Apr 19, 2021 at 05:42:51PM +1200, Thomas Munro wrote: > > > The question we asked ourselves > > multiple times in the other thread was how we're supposed to get to > > the modern BCP 47 form when creating the template databases. It

Re: Windows default locale vs initdb

2021-05-15 Thread Noah Misch
On Mon, Apr 19, 2021 at 05:42:51PM +1200, Thomas Munro wrote: > Currently initdb sets up template databases with old-style Windows > locale names reported by the OS, and they seem to have caused us quite > a few problems over the years: > > db29620d "Work around Windows locale name with non-ASCII

Re: Windows default locale vs initdb

2021-04-19 Thread Peter Eisentraut
On 19.04.21 07:42, Thomas Munro wrote: It looks like one possibility, since Vista, is to call GetUserDefaultLocaleName()[2], which doesn't appear to have been discussed before on this list. That doesn't allow you to ask for the default for each individual category, but I don't know if that is

Re: Windows default locale vs initdb

2021-04-19 Thread Andrew Dunstan
On 4/19/21 10:26 AM, Dave Page wrote: > > > On Mon, Apr 19, 2021 at 11:52 AM Andrew Dunstan > wrote: > > > My understanding from Microsoft staff at conferences is that > Azure's PostgreSQL SAS runs on  linux, not WIndows. > > > This is from a regular Azure

Re: Windows default locale vs initdb

2021-04-19 Thread Dave Page
On Mon, Apr 19, 2021 at 11:52 AM Andrew Dunstan wrote: > > My understanding from Microsoft staff at conferences is that Azure's > PostgreSQL SAS runs on linux, not WIndows. > This is from a regular Azure Database for PostgreSQL single server: postgres=> select version();

Re: Windows default locale vs initdb

2021-04-19 Thread Pavel Stehule
po 19. 4. 2021 v 12:52 odesílatel Andrew Dunstan napsal: > > > On Mon, Apr 19, 2021 at 4:53 AM Pavel Stehule > wrote: > >> >> >> po 19. 4. 2021 v 7:43 odesílatel Thomas Munro >> napsal: >> >>> Hi, >>> >>> Moving this topic into its own thread from the one about collation >>> versions, because

Re: Windows default locale vs initdb

2021-04-19 Thread Andrew Dunstan
On Mon, Apr 19, 2021 at 4:53 AM Pavel Stehule wrote: > > > po 19. 4. 2021 v 7:43 odesílatel Thomas Munro > napsal: > >> Hi, >> >> Moving this topic into its own thread from the one about collation >> versions, because it concerns pre-existing problems, and that thread >> is long. >> >>

Re: Windows default locale vs initdb

2021-04-19 Thread Pavel Stehule
po 19. 4. 2021 v 7:43 odesílatel Thomas Munro napsal: > Hi, > > Moving this topic into its own thread from the one about collation > versions, because it concerns pre-existing problems, and that thread > is long. > > Currently initdb sets up template databases with old-style Windows > locale

Windows default locale vs initdb

2021-04-18 Thread Thomas Munro
Hi, Moving this topic into its own thread from the one about collation versions, because it concerns pre-existing problems, and that thread is long. Currently initdb sets up template databases with old-style Windows locale names reported by the OS, and they seem to have caused us quite a few