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 1sWAsp-00DdmN-LH for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 08:28:31 +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 1sWAsm-00BSpA-8T for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2024 08:28:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sWAsl-00BSp1-OJ for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2024 08:28:28 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sWAsi-0010FQ-Am for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2024 08:28:26 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-44d1eb90522so21505601cf.0 for ; Tue, 23 Jul 2024 01:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1721723303; x=1722328103; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZEB0QSN/RlHRW8YHsUvsc0bP2f934UyP5FClilcb1OE=; b=MGR6zUCn8txNg9R2J82PZU1WCF6zk6P827DjvdCzwYHJaBxNHmpt/6oUV6JxF6ce2G 4dhPHErAsmIjJGn9+vk+oh00vhH9/k2DhWj6spVqcpy2vNHi/T8vU2MvhFrQQCSQorGL avGOYjNky6z5cu96Ld8Zj9PO2LzRjHBFa9WPDZJaHieNam/3JdMevQx65HUrD29f1KkI IJeGet6Cdly4/Nrl4xms5zxP1nvEChHVaiL/uXzFMnod+9epmuzPYTI2ER19tku6lV2E 9mRi9LjF5grbJ/0oesJskhY1KerBKYlY8Z0MQpCgx1ld1dUoCOlO97ik3C4nBvd8fVd2 5Qbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721723303; x=1722328103; h=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=ZEB0QSN/RlHRW8YHsUvsc0bP2f934UyP5FClilcb1OE=; b=Mla4WOc2QQ2koHP+0WbGaoV5dTIzMrjEZ0iigr6ExA6Q3MaeGQHvqejAJrR6rs4Zon vAivXk/J22LrjaU3sU8uL6Vl5cpAdSGf4PaiGGFhLhqj0kzRVdI9HRvVoZ/KH7rjuX2y WUc8GdZw1HfFUFCQTO9x3RXHjdjOkL0BcHTvbUzgvcjH42INqXxQn2aDoy8GzyDrYNK4 sIe6EQSTUFslOQt+wQ8NvUAqdbMEV4FPd5hBGtI1DQ7y6B7OHZu9zPyPBMAZpc98cVcV EHOP0GB+Uu6J78XKYT1MTk+1mvjMjezyFlOMPsNNLjIZxHr75yyhCKKVzne0LP34m/9q Yn4A== X-Forwarded-Encrypted: i=1; AJvYcCXZOmD6G181sp57l/lqtpp17vip4Lh+tUJlX27l5OwuZ7nWD1tEAq4DMgilLYBXC4rROYHLcU7GjY56TnLTm3IIcCi4zwpZuH9j1V9D70eVsmvo X-Gm-Message-State: AOJu0Yx4yf5D6YhDfK3Fxx2g0dKk+WO9owQ8ep6mSHZvFFlXyj4rCe0i 3pALLwe6IxJJDjQBZpZ/6hkveYabvmPojHMj8Da6NTtmCJf2TgMTtdX74jDsokfJWTG9fCCNJJa GG1l88v5tZ3degnGQHMeR9K4RkYRY9GKKwgLr X-Google-Smtp-Source: AGHT+IFTBzbhSCbzU2rtBD6m9jj9iShCvz9u9ZgPKZtU124sZWN9n69+TlU5qmqZLPZXoL+3t0639kac08sFjlfqOxM= X-Received: by 2002:ac8:5889:0:b0:447:e769:76fc with SMTP id d75a77b69052e-44fc55311fbmr19977631cf.34.1721723303027; Tue, 23 Jul 2024 01:28:23 -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: Dave Page Date: Tue, 23 Jul 2024 09:28:11 +0100 Message-ID: Subject: Re: Windows installation problem at post-install step To: Thomas Munro Cc: Sandeep Thakkar , =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= , Adrian Klaver , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e0ffec061de5f1d7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e0ffec061de5f1d7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 23, 2024 at 1:27=E2=80=AFAM Thomas Munro wrote: > On Mon, Jul 22, 2024 at 11:51=E2=80=AFPM Sandeep Thakkar > wrote: > > EDB's windows installer gets the locales on the system using the > https://github.com/EnterpriseDB/edb-installers/blob/REL-16/server/scripts= /windows/getlocales/getlocales.cpp > and then substitute some patterns ( > https://github.com/EnterpriseDB/edb-installers/blob/REL-16/server/pgserve= r.xml.in#L2850) > I'm not sure why we do that but that is the old code and probably @Dave > Page may know but I'm not sure if that piece of code is responsible for > this change in encoding in this case. > > Ah, so it's calling EnumSystemLocales(). Interestingly, the > documentation for that function says: > > "Note For interoperability reasons, the application should prefer the > EnumSystemLocalesEx function to EnumSystemLocales because Microsoft is > migrating toward the use of locale names instead of locale identifiers > for new locales. Any application that will be run only on Windows > Vista and later should use EnumSystemLocalesEx." > > That seems to be talking about this exact issue, that we're supposed > to be using "locale names". I'm a little confused about the > terminology for the various types of names and identifiers but if you > follow the link to a example program[1] you can see that it's talking > about the BCP47 "en-US" kind, that we want. (That quote makes it > sound like a new thing, but Vista came out ~17 years ago.) > Vista is when they added support for BCP47, but of course, back when that code was written we were primarily supporting older versions of Windows still, back to Windows 2000 iirc. > > So one idea would be that in v18, we not only change initdb.exe to > pick a BCP47 locale name by default as I proposed in that other > thread[2], but also in the v18 version of the EDB installer you > consider switching that code over to EnumSystemLocalesEx(). Then we > can start to kiss goodbye to the bad old names. People would still > propagate them into the future with pg_upgrade I guess, and it'd be up > to users to replace them by updating their catalogs manually. Does > that make sense? > Yes, it does (spitballing: might be nice if we could automatically update the catalogs as well). --=20 Dave Page VP, Chief Architect, Database Infrastructure EDB: https://www.enterprisedb.com --000000000000e0ffec061de5f1d7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jul 23, 2024 at 1:27=E2=80=AF= AM Thomas Munro <thomas.munro@= gmail.com> wrote:
On Mon, Jul 22, 2024 a= t 11:51=E2=80=AFPM Sandeep Thakkar
<s= andeep.thakkar@enterprisedb.com> wrote:
> EDB's windows installer gets the locales on the system using the <= a href=3D"https://github.com/EnterpriseDB/edb-installers/blob/REL-16/server= /scripts/windows/getlocales/getlocales.cpp" rel=3D"noreferrer" target=3D"_b= lank">https://github.com/EnterpriseDB/edb-installers/blob/REL-16/server/scr= ipts/windows/getlocales/getlocales.cpp and then substitute some pattern= s (https://gi= thub.com/EnterpriseDB/edb-installers/blob/REL-16/server/pgserver.xml.in#L28= 50) I'm not sure why we do that but that is the old code and probab= ly @Dave Page=C2=A0 may know but I'm not sure if that piece of code is = responsible for this change in encoding in this case.

Ah, so it's calling EnumSystemLocales().=C2=A0 Interestingly, the
documentation for that function says:

"Note=C2=A0 For interoperability reasons, the application should prefe= r the
EnumSystemLocalesEx function to EnumSystemLocales because Microsoft is
migrating toward the use of locale names instead of locale identifiers
for new locales. Any application that will be run only on Windows
Vista and later should use EnumSystemLocalesEx."

That seems to be talking about this exact issue, that we're supposed to be using "locale names".=C2=A0 I'm a little confused about= the
terminology for the various types of names and identifiers but if you
follow the link to a example program[1] you can see that it's talking about the BCP47 "en-US" kind, that we want.=C2=A0 (That quote mak= es it
sound like a new thing, but Vista came out ~17 years ago.)
=

Vista is when they added support for BCP47, but of cour= se, back when that code was written we were primarily supporting older vers= ions of Windows still, back to Windows 2000 iirc.
=C2=A0

So one idea would be that in v18, we not only change initdb.exe to
pick a BCP47 locale name by default as I proposed in that other
thread[2], but also in the v18 version of the EDB installer you
consider switching that code over to EnumSystemLocalesEx().=C2=A0 Then we can start to kiss goodbye to the bad old names.=C2=A0 People would still propagate them into the future with pg_upgrade I guess, and it'd be up<= br> to users to replace them by updating their catalogs manually.=C2=A0 Does that make sense?

Yes, it does (spitball= ing: might be nice if we could automatically update the catalogs as well).<= /div>

-- =
Dave PageVP, Chief Architect, Database Infrastructure
EDB:=C2=A0https://www.enterprisedb.com<= /a>

--000000000000e0ffec061de5f1d7--