Follow these steps to solve errors when installing Postgresql on Windows 8.1 and Windows 10.
- Create a new user account, called postgres
- Add the new account to the Administrators and Power Users groups.
- Restart the computer. The next step will not work without doing so.
- 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, as it is not required after installation.