6

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
  • Please provide some clarifications if you installled postgresql as administrator.. Commented Mar 21, 2019 at 15:09

3 Answers 3

9

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:

  1. Uninstall PostgreSQL

  2. Delete the postgres user if it still exists.

     net user postgres /delete 
  3. Create the postgres user with a password

     net user /add postgres <password> 
  4. Add the postgres user to the Administrators group

     net localgroup administrators postgres /add 

5a. Add the postgres user to the Power Users group

 net localgroup "power users" postgres /add 

5b. Add the postgres user to the administrator's local-group

 net localgroup Administrators postgres /add 
  1. Run a command window as the postgres user

     runas /user:postgres cmd.exe 
  2. 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.

  3. Remove the postgres user from the Administrators group.

     net localgroup administrators postgres /delete 

as mentioned by @Imraan on DBA -> Link

Edit in regards to @Youssef's comment:

Depending on the version and scenario, the user postgres needs to be added to administrator's localgroup instead of power users.

Short overview about power-users from superuser SE:

Note: in Windows 7 and above, Power Users only exists for legacy purposes, and is the same as ordinary Users, unless an admin explicitly adds extra rights to the group.

Power-users may:

  • Run legacy applications, in addition to Windows 2000 or Windows XP Professional certified applications.

  • Install programs that do not modify operating system files or install system services.

  • Customize systemwide resources including printers, date, time, power options, and other Control Panel resources.

  • Create and manage local user accounts and groups.

  • Stop and start system services which are not started by default.

  • Power Users do not have permission to add themselves to the Administrators group.

  • Power Users do not have access to the data of other users on an NTFS volume, unless those users grant them permission.

Sign up to request clarification or add additional context in comments.

1 Comment

I had to add postgres to administrators localgroup instead of power users
0

As for me, all I had to do to was to run the installer as an administrator enter image description here

Comments

0

If the previous answers did not help, check the password you insert. I had the same issue and, as mentioned in this post, I just had to enter an alphanumeric password and I could finish the installation without further problems.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.