Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

问题一:There has been an error. An error occured executing the Microsoft VC++ runtime installer.

      如下图:

                         Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

       解决办法:(1)在exe安装文件的同级目录,新建一个文本文档,

                        (2)在文档中输入postgresql-11.1-1-windows-x64.exe --install_runtimes 0

                         (3)修改文本文档后缀为.bat

                         (4)运行这个批处理文件,启动成功,如下图所示:

Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

                      

问题二:Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed.

错误信息如下图:

Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

解决办法:(1)先卸载了PostgreSQL(可用360进行卸载),参考网上的教程删了注册表,然后用再次重装

                  (2)重装过程,有2个地方需要注意:

                               第1处:语言应该选默认值,否则还是会报错,如下图:

              Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

             第2处:Data Directory 应该安装在这里,否则会报错,如下图:   

              Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

最后安装成功,点击左侧 Servers > Postgre SQL 11,输入密码,点击 OK 即可。

Windows 安装 PostgreSQL安装失败-问题汇总解决!!!

Windows 安装 PostgreSQL安装失败-问题汇总解决!!!