作者:类延良,任职于瀚高根底软件股份有限公司,PostgreSQL数据库技术爱好者,10g &11g OCM,OGG认证专家。

一、环境阐明

1.Windows2012R2的版本见下,未打任何的OS补丁

2.采纳的介质是postgresql-12.5-1-windows-x64.exe,从EDB公司下载的介质,曾经验算过该介质的SHA256,没问题。
3.PostgreSQL12 x64bit是反对Windows 2102R2的,如下截图来自https://www.postgresql.org/download/windows/

二、装置报错

三、问题剖析与解决

家喻户晓,在Windows下装置部署用C开发的程序(比方OGG,比方vmware workstations等等),都须要装置Microsoft Visual C++ 2015-2019 Redistributable,这个安装包须要阐明如下:

1.该安装包的下载网址是:
https://support.microsoft.com/en-in/help/2977003/the-latest-supported-visual-c-downloads
2.该安装包辨别x86、x64、ARM64,请留神务必下载正确
3.该安装包对Windwos版本的要求如下,来自于网址
https://docs.microsoft.com/zh-cn/visualstudio/releases/2019/system-requirements

上述网址有如下的形容:
“Visual C++ 2015-2019 Redistributable 反对与 Visual Studio 雷同的零碎要求”,那么就来看Visual Studio 2019对操作系统的要求,见下:
Visual Studio 2019 将在以下操作系统上装置并运行(倡议应用 64 位;不反对 ARM):

  • Windows 10 版本 1703 或更高版本:家庭版、专业版、教育版和企业版(不反对 LTSC 和 Windows 10 S)
  • Windows Server 2019:Standard 和 Datacenter
  • Windows Server 2016:Standard 和 Datacenter
  • Windows 8.1(带有更新 2919355):外围板、专业版和企业版
  • Windows Server 2012 R2(更新 2919355):Essentials、Standard、Datacenter
  • Windows 7 SP1(带有最新的 Windows 更新):家庭高级版、专业版、企业版、旗舰版

4.Visual C++ 2015, 2017 and 2019 all share the same redistributable files

For example, installing the Visual C++ 2019 redistributable will affect programs built with Visual C++ 2015 and 2017 also. However, installing the Visual C++ 2015 redistributable will not replace the newer versions of the files installed by the Visual C++ 2017 and 2019 redistributables.

本文摘自:
https://support.microsoft.com/en-in/help/2977003/the-latest-supported-visual-c-downloads

从如上剖析能够看出,Visual C++ 2015-2019 Redistributable 在Windows2012R2下装置,须要Windows2012R2带有更新 2919355。我特意尝试过当Windows2012R2不带任何OS补丁的状况上来装置Visual C++ 2015-2019 Redistributable,后果OS蓝屏故障,进而导致OS重启,所以,请务必为Windows2012R2装置更新 2919355。

上面就来为Windows2012R2装置更新 2919355

Windows2012R2的更新 2919355对应的补丁下载网址
https://www.microsoft.com/zh-CN/download/details.aspx?id=42334

如下是打补丁的程序,请顺次执行即可:

  1. clearcompressionflag.exe
  2. KB2919442
  3. KB2975061本补丁下载自http://support.microsoft.com/kb/2975061/
  4. KB2919355若是不装置KB2975061,那么在装置KB2919355时将装置将失败,事件查看器中的错误代码为 0x80070005。装置KB2919355耗时1小时,须要重启OS失效。
  5. KB2932046,重启os失效
  6. KB2959977,重启os失效
  7. KB2937592,不须要重启
  8. KB2938439,重启os失效
  9. KB2934018,重启os失效

以上九个步骤倡议预留至多2个小时的工夫进行OS补丁更新,请布局好停机工夫。

装置完更新 2919355之后,再去运行postgresql-12.5-1-windows-x64.exe即可。

更多PostgreSQL常识问答、技术文章,请拜访PGFans问答社区:www.pgfans.cn