Re: Windows default locale vs initdb

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Windows default locale vs initdb
Date: 2022-07-19 02:46:48
Message-ID: CA+hUKGK3zubzq_JZ8MU=zzjOLKKgdq_Knyf_Bra042nqj8gf3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 19, 2022 at 10:58 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> 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 report GetLastError() where I'd mixed up %d and %lu, I
see also that I didn't quite follow existing conventions for wording
when reporting Windows error numbers, so I fixed that too.

In the "startcreate" step on CI you can see that it says:

The database cluster will be initialized with locale "en-US".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".

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 goal here was to give Windows users
good defaults, but WIN1252 is probably not what most people actually
want. Hmph.

Attachment Content-Type Size
v2-0001-Default-to-BCP-47-locale-in-initdb-on-Windows.patch text/x-patch 3.8 KB
v2-0002-Remove-support-for-old-Windows-locale-names.patch text/x-patch 19.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2022-07-19 02:47:39 Re: doc: New cumulative stats subsystem obsoletes comment in maintenance.sgml
Previous Message David G. Johnston 2022-07-19 02:39:55 Re: Doc about how to set max_wal_senders when setting minimal wal_level