Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSNFY-0004KL-DH for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 15:29:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSNFX-0002jU-6o for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 15:29:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSNFW-0002iw-Vc for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 15:29:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSNFU-0005v2-8R for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 15:29:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xA6FTTOZ028362; Wed, 6 Nov 2019 10:29:30 -0500 From: Tom Lane To: "Skjalg A. Skagen" cc: Bruce Momjian , "pgsql-bugs@lists.postgresql.org" Subject: Re: PostgreSQL 12 installation fails because locale name contained non-english characters 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> Comments: In-reply-to "Skjalg A. Skagen" message dated "Wed, 06 Nov 2019 09:30:34 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <28360.1573054169.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 06 Nov 2019 10:29:29 -0500 Message-ID: <28361.1573054169@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Skjalg A. Skagen" writes: > If you mean what I see in the drop-down menu during installation, I see = "Norwegian Bokm=C3=A5l, Norway" -- identical to what getlocales.exe report= ed 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?vi= ew=3Dvs-2019 are all-lower-case. regards, tom lane