Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sVhcg-00BCXz-OI for pgsql-general@arkaria.postgresql.org; Mon, 22 Jul 2024 01:13:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sVhcd-00Dabf-Tx for pgsql-general@arkaria.postgresql.org; Mon, 22 Jul 2024 01:13:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sVhcd-00DabX-Iv for pgsql-general@lists.postgresql.org; Mon, 22 Jul 2024 01:13:51 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sVhca-000n2J-VG for pgsql-general@lists.postgresql.org; Mon, 22 Jul 2024 01:13:51 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3683f56b9bdso1737772f8f.1 for ; Sun, 21 Jul 2024 18:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721610828; x=1722215628; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sNbAPz9D9qVF4gN/OuY1SYPRwNrO3u2x4CjQpGoL1Uc=; b=nbh5+B22d25WeqK+BP0HAc7XNJxPBUfOa9ag/cDAuYJ1Jb2Hew0m9Ejj/cfjed/D6+ NvF566+jogkaOnnjHfATv0FiZkoBp+AqUjLvQbbslujTGI45Fxjogw7SOlFTeeEAJ1n2 97yJLfR+TmzP81guuUd91CieHM0RQaT3nADZRTTs0M5OGJhypQXRhYGR1LpIL3A8m7ci JorynLRSp4nxmi1+5uoJCPa/VRjADvhTlTAF2WfDKq+IRidsXawUSh4KmjAlt5sq4H4v 2rTGqOP2C2kZaN/qN5tBRiHHhtkcBoE8z+aDA2WRGBolHBjuLXu65d/Yfwpr1BbZN+ql 5ygg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721610828; x=1722215628; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sNbAPz9D9qVF4gN/OuY1SYPRwNrO3u2x4CjQpGoL1Uc=; b=ZtdngCtFm0hPLMEbasFrTw7OXZaafRO497Z8gMcdJjCvPt/2qYhJSd0he+baj235MB tjKxLBNNW0hzuW3gSmTPxZg4X+KDVwSez2ssZNFg0qyPtfO/a9KWDS/u3CEJjHvzNL4V JbHLd42K3XBnJbu1vofChlkyuC9VGGI8ouOVp551Q4cE+rvLEQPJWdAkRlK4CikYCFpw W0kNTvE+RcHlkAfk/uOvqF0FayIVpX23qB+wIPzv5UsunjQm4GEjHVHoezJQCq11X5MV kTsWxpoTYtF7jut3l0g9Iasmfu6wD21gb+JeLEiPH+2QDVNUUnlhN+Sv5O+4u2Wvg+iL 12Tw== X-Forwarded-Encrypted: i=1; AJvYcCW/kNnjBOYm6/SV0seUbkx5QqDSGFhespkJjxtNzzX4OxvWE2pUcyNiovJVAyVvp1+0JebCLmBt/Xoct0kL04qocmsUdxbGPkh32HZsXU7DRV2T X-Gm-Message-State: AOJu0YzAIN6q0bqo4LGejNtV+RbZbYw7gwWRhgAYotgQBWdoJyuY0BGi 6sg/P7HUzq5C20NCAa4rhv4FO4jb4izIBOKCu8R7CA5RLHGswqE/U0GkyHOoHWv6f+scqtlamEF +ZNxmvdNltBm7BMAx/LWoLG2Y7gtBAXn4 X-Google-Smtp-Source: AGHT+IHH9In8AV7IxUgt54MNw7O/zaRkX/WkISW6iOU5tXiSK0uqdvHwsxmOil1tf1oXPmyvNVlwvGFcrZRRMoLvdNo= X-Received: by 2002:a5d:5f44:0:b0:368:c700:758d with SMTP id ffacd0b85a97d-369bbbbe168mr4270480f8f.28.1721610827723; Sun, 21 Jul 2024 18:13:47 -0700 (PDT) MIME-Version: 1.0 References: <80c9b0ea-c874-40ad-a006-fb1eb37464c2@aklaver.com> <44b44ece-dce6-4b4f-b751-8787a5a071e0@aklaver.com> In-Reply-To: From: Thomas Munro Date: Mon, 22 Jul 2024 13:13:10 +1200 Message-ID: Subject: Re: Windows installation problem at post-install step To: =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= Cc: Adrian Klaver , pgsql-general@lists.postgresql.org, Sandeep Thakkar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 22, 2024 at 11:58=E2=80=AFAM Ertan K=C3=BC=C3=A7=C3=BCkoglu wrote: > Thomas Munro , 21 Tem 2024 Paz, 23:27 tarihinde = =C5=9Funu yazd=C4=B1: >> 2. Some existing database clusters which had been installed with the >> name "Turkish_Turkey.1254" became unstartable when the OS upgrade >> renamed that locale to "Turkish_T=C3=BCrkiye.1254". I'm trying to provi= de >> a pathway[2] to fix such systems in core PostgreSQL in the next minor >> release. Everyone affected probably already found another way but at >> least next time a country is renamed this might help with the next >> point too. > > I was also hit by that OS update. > There is a Microsoft tool for creating a locale installer > https://www.microsoft.com/en-us/download/details.aspx?id=3D41158 > Using that tool and adding a second locale Turkish_Turkey.1254 (name befo= re Microsoft update) in the OS can fix your broken PostgreSQL. > I believe most people simply choose this path. > There are also several blogs/articles written in Turkish about the proble= m. If that's easy and good enough then maybe I should abandon that on-the-fly renaming patch and we should just do a little documentation note... >> 3. I'd also like to teach initdb to use BCP47 names like "tr-TR" >> instead of those names by default (ie if you don't specify a locale >> name explicitly), and have proposed that before[3] but it hasn't gone >> in due to lack of testing/reviews from Windows users. It seems like >> that doesn't matter much in practice to all the people using the >> popular EDB installer, since it apparently takes control of picking >> the locale and explicitly passes it in (and screws up the encoding as >> we have now learned). > > If I am not mistaken BCP47 names are already used in Linux systems. > Using them would make PostgreSQL use the same locale names across Linux a= nd Windows systems. Not exactly. POSIX systems use [language[_territory][.codeset][@modifier]], but POSIX doesn't say what any of those components are[1] (are they ISO country codes? English words? Hieroglyphs?), so, curiously, those Windows names like "English_United States.1252" are probably POSIX-conforming. Every real POSIX system of course uses ISO language and country codes these days (though I still recall other names being used years ago), so they look similar to the simpler kinds of BCP47 tags, which are just language-country with the same ISO codes but a different separator. They diverge further once you get into the finer points with more components. Incidentally that lack of standardisation is the reason you can't say that the glibc ".utf8" ending is "wrong", even though it is obviously stupid :-p (all systems I know accept .UTF-8, 'cause that's what Ken Thompson, Rob Pike and the Unicode standard called it). I suspect that Windows accepts the POSIX style en_US too, but it's not what the manual tells you to use. But really we shouldn't have to know or care how locales are named; we should get the names from the OS in the first place, and then we should remember them and give them back to the OS at the right times. The two problems here is that Windows has two kinds, one unstable over time and with illegal (for us) characters in the name, and one stable; we need to find all the places where the old unstable ones can get into our system, and block them off. I'm aware of two places now: the EDB installer, and initdb's default for people who run it on the command line with giving an explicit name. > I can help with the testing part. Let me know the details, please. Thanks! I will rebase that patch, and CC you on the thread. [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.htm= l