While installing PostgreSQL I keep getting the message:
"Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed."
This seems to prevent me from using PGadmin correctly.
In the install log I have found the following section which seems to indicate where things went wrong.
I haven't been able to find a solution to this problem.
Executing batch file 'rad7C33E.bat'...
The program "postgres" was found by "C:/Program Files/PostgreSQL/11/bin/initdb.exe"
but was not the same version as initdb.
Check your installation.
Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo "C:\Program Files\PostgreSQL11円/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\JesseDanckaarts\AppData\Local\Temp/postgresql_installer_6f373c7c91" "C:\Program Files\PostgreSQL11円" "C:\Program Files\PostgreSQL11円\data" 5432 "Dutch,Netherlands" 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
Executing icacls "C:\Users\JesseDanckaarts\AppData\Local\Temp/postgresql_installer_cb3c83cf49" /inheritance:r
Script exit code: 0
I have tried the following without luck so far:
- https://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#Common_installation_errors
- https://webkul.com/blog/postgresql-windows-installation-problem-running-post-install-step-installation-may-not-complete-correctly/
- https://www.2ndquadrant.com/en/blog/postgresql-cluster-initialisation-failures-no-error-windows/
and many more!
If anyone knows what could be the problem I'd be very grateful!
1 Answer 1
Cross posting from StackOverflow:
I've just struggled with this for several hours, so I'm posting this for anyone else who winds up here.
Initially, all I could find were two bug reports on the pgsql-bugs
mailing list:
BUG #15856: The program "postgres" was found by "initdb" but was not the same version as initdb.
BUG #15970: Db initialization error - initdb.exe and postgres not same version
The specific symptoms are:
The program "postgres" was found by ".../initdb.exe" but was not the same version as initdb.
and although the versions match, you get this:
C:\Program Files\PostgreSQL11円\bin>postgres -V
WARNING: 01000: could not determine encoding for locale
"<some encoding>.utf8": codeset is "CPutf8"
If these are your symptoms, the issue is that you have your region/language settings set to use UTF-8 (beta setting). This causes problems with lots of programs, and PostgreSQL is one of them. Disable this and re-install and you should be fine.
-
1This is godlike answer! You just stopped my 2 hours of setup mayhem. Guess what... even in postgres 12, this can still be reproduced. Did you file this into enterprisedb?sandthorn– sandthorn2019年10月27日 06:58:41 +00:00Commented Oct 27, 2019 at 6:58
-
Still the same in 12.2.2. Been trying to get it installed for hours, and if I hadn't found this answer...Luc VdV– Luc VdV2020年03月25日 09:55:37 +00:00Commented Mar 25, 2020 at 9:55
-
Thank you so much for the answer! This workaround worked flawlessly when upgrading from 12 to 13. I would never have thought about it.Burak Tamtürk– Burak Tamtürk2020年10月04日 19:12:34 +00:00Commented Oct 4, 2020 at 19:12
postgres
executable on thePATH
. Deinstall all other PostgreSQL installations and make sure there is no otherpostgres
executable around.