2

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\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\JesseDanckaarts\AppData\Local\Temp/postgresql_installer_6f373c7c91" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\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:

and many more!

If anyone knows what could be the problem I'd be very grateful!

5
  • Looks like there is another postgres executable on the PATH. Deinstall all other PostgreSQL installations and make sure there is no other postgres executable around. Sep 2 '19 at 15:02
  • You don't need to install Postgres in order to use pgAdmin. If you just want to connect to an existing server with pgAdmin, it's enough to download and install that: pgadmin.org/download Sep 2 '19 at 15:04
  • @LaurenzAlbe I have already tried uninstalling and even manually removing all leftovers.
    – Jesse
    Sep 2 '19 at 15:08
  • @a_horse_with_no_name I will be running a local database to use with Mendix.
    – Jesse
    Sep 2 '19 at 15:10
  • You wrote "prevent me from using PGadmin" so I assumed you just want to use pgAdmin Sep 2 '19 at 19:22
6

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\PostgreSQL\11\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.

UTF8 Region Settings screenshot

3
  • 1
    This 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
    Oct 27 '19 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
    Mar 25 '20 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. Oct 4 '20 at 19:12

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .