问题
When I tried to install PostgreSQL on Windows 10 (64-bit), I was getting a prompt saying:
'Failed to load SQL modules into the database cluster'
and
'problem running post-install setup'.
回答1:
Did you install postgresql with administrator-privileges?
This might be due to a privilege-issue, you can try to:
- Create a new user account, called postgres
- Add the new account to the Administrators and Power Users groups
Restart the computer
Run a command prompt as the postgres user, using the command:
runas /user:postgres cmd.exe
- Run the installer from the postgres command window
- Delete the postgres user account, as well as the user directory
Another option is to:
- 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
Add the postgres user to the Power Users group
net localgroup "power users" 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
as mentioned by @Imraan on DBA -> Link
来源:https://stackoverflow.com/questions/55282696/issues-while-installing-postgresql-in-windows-10