The setup: Windows 10, postgreSQL 12.3, all the values are default.
The problem: While installing postgresql 12.3 I get an error message at the end of the installation: "problem running post-install step. Installation may not complete correctly. The database cluster initialisation failed" When I then try to run the SQL shell (through the start menu), and I press enter to default all the values, it gives me a connection refused error.
When uninstalling postgreSQL, I also get an error message: "Error deleting service postgresql-x64- 12" two times.
What I tried:
- installing postgreSQL in a directory C:\postgresql (as opposed to in the Program files)
- There was no service related to postgreSQL, so I added it manually with this commandline (openened cmd as admin in the postgresql bin directory)
pg_ctl.exe register -N "PostgreSQL" -U "NT AUTHORITY\NetworkService"-D "C:/Program Files/postgresql/pgsql/bin/pgsql/data" -w
- Uninstalling/Reinstalling postgresql, rebooting the PC
- Disabling all firewalls
- Checking that the COMSPEC environement variable is valid with
echo %COMSPEC%
and"%COMSPEC%" /C "echo test ok"
- Ran regedit, went to the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services", there was a postgreSQL service (after adding it manually)