'未能将SQL模块加载到数据库群集中'
以及
'运行后安装设置时出现问题'。
您是否以管理员权限安装了PostgreSQL?
这可能是由于权限问题,您可以尝试:
创建一个名为postgres的新用户账户
将新账户添加到Administrators和Power Users组中
重新启动计算机
以postgres用户身份运行命令提示符,使用命令:runas /user:postgres cmd.exe
从postgres命令窗口运行安装程序
删除postgres用户账户和用户目录
另一种选择是:
Uninstall PostgreSQL
Delete the postgres user if it still exists.
net user postgres /delete
Create the postgres user with a password
net user /add postgres <password>
Add the postgres user to the Administrators group
net localgroup administrators postgres /add
5a. 将postgres用户添加到Power Users组中
net localgroup "power users" postgres /add
5b. 将postgres用户添加到管理员的本地组中
net localgroup Administrators postgres /add
Run a command window as the postgres user
runas /user:postgres cmd.exe
Run the install file from within the command window.
C:\Download\postgresql-9.6.12-windows.exe // or whatever version you are using
This should run the installation successfully.
Remove the postgres user from the Administrators group.
net localgroup administrators postgres /delete
如@Imraan在DBA中所提到的 -> 链接
针对@Youssef的评论进行编辑:
根据版本和场景的不同,用户postgres
需要添加到管理员的localgroup
而不是power users
。
来自超级用户SE的有关power-users的简要概述:
注:在Windows 7及以上版本中,Power Users仅用于遗留目的,并且与普通用户相同,除非管理员明确向该组添加了额外的权限。
Power-users可以执行以下操作:
运行传统应用程序,以及 Windows 2000 或 Windows XP 专业认证的应用程序。
安装不修改操作系统文件或安装系统服务的程序。
自定义系统范围内的资源,包括打印机、日期、时间、电源选项和其他控制面板资源。
创建和管理本地用户帐户和组。
停止和启动未默认启动的系统服务。
Power Users无权将自己添加到Administrators组。
Power Users无权访问NTFS卷上其他用户的数据,除非这些用户授予他们权限。