From: Tom Lane <tgl@sss.pgh.pa.us>
To: Skjalg A. Skagen <skjalg.skagen@pm.me>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: PostgreSQL 12 installation fails because locale name contained non-english characters
Date: Wed, 06 Nov 2019 10:29:29 -0500
Message-ID: <28361.1573054169@sss.pgh.pa.us> (raw)
In-Reply-To: <0JMgntHjNV6lvZjE4mr6cd1bxhxPSdp0Upve8WYY2djchvBvfzrxyB8tVtWaq1pw85A4reFxU0rpjxUZrd3U2_K6YTI1LQj4ZEXWQUyG-mY=@pm.me>
References: <_Rkh_eJ7FKRUdGms9GAub53-5uvodq4uvTIrbgsTQ13wwHJwj7ofpHXUUtT0JMQft6oXI68hqJTx1bLIaejbuTyu29xeTGrSBCCgl40U1GA=@pm.me>
<20191105024819.GB12780@momjian.us>
<11659.1572974541@sss.pgh.pa.us>
<0JMgntHjNV6lvZjE4mr6cd1bxhxPSdp0Upve8WYY2djchvBvfzrxyB8tVtWaq1pw85A4reFxU0rpjxUZrd3U2_K6YTI1LQj4ZEXWQUyG-mY=@pm.me>
"Skjalg A. Skagen" <skjalg.skagen@pm.me> writes:
> If you mean what I see in the drop-down menu during installation, I see "Norwegian Bokmål, Norway" -- identical to what getlocales.exe reported in my installation log file on line 222:
OK, thanks for confirming. So the committed patch does *not* add enough
flexibility to cover this case.
I wrote:
>> I wonder whether we need to relax the matching code to be entirely
>> agnostic about spaces and punctuation in the Windows locale name.
After googling a little bit, I could not find any indication that
Microsoft promises anything at all about the stability of these
long-form locale names. They document short names similar to the
Unix conventions, e.g. "en-US" and "nb-NO", as being the stable
forms that applications are encouraged to use. So somewhere there
is code that converts these long-form names to the standardized
representation, and it would be entirely reasonable for that code
to try to be forgiving. Thus, it's no surprise that we're getting
bit by small variations like these.
I'm inclined to think that we ought to ignore anything that isn't
an ASCII letter while trying to match these locale names. That's
a little bit problematic in terms of what win32setlocale.c does
today, because it tries to replace "just the matched string",
but it'd be unclear where the match ends if there are ignorable
characters. But probably we could change it so that it just takes
the translation and then tacks on ".NNNN" if the input ends with
a dot and digits.
Maybe case insensitivity would be a good idea too? The existing
code hasn't got that refinement, so maybe it's not important,
but the examples I'm seeing in places like
https://docs.microsoft.com/en-us/cpp/c-runtime-library/language-strings?view=vs-2019
are all-lower-case.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, skjalg.skagen@pm.me, bruce@momjian.us
Subject: Re: PostgreSQL 12 installation fails because locale name contained non-english characters
In-Reply-To: <28361.1573054169@sss.pgh.pa.us>
References: <_Rkh_eJ7FKRUdGms9GAub53-5uvodq4uvTIrbgsTQ13wwHJwj7ofpHXUUtT0JMQft6oXI68hqJTx1bLIaejbuTyu29xeTGrSBCCgl40U1GA=@pm.me> <20191105024819.GB12780@momjian.us> <11659.1572974541@sss.pgh.pa.us> <0JMgntHjNV6lvZjE4mr6cd1bxhxPSdp0Upve8WYY2djchvBvfzrxyB8tVtWaq1pw85A4reFxU0rpjxUZrd3U2_K6YTI1LQj4ZEXWQUyG-mY=@pm.me> <28361.1573054169@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox