How To Solve “Problem running post install step…the Database Cluster Initialisation failed” on PostgreSQL Windows Installation

One day, when I install PostgreSQL on Windows, it always report the following error:

Problem running the post-install step. Installation may not complete correctly.

… when the installation progress bar reached the end.

My configuration:

  • Windows 7 Professional 64-bit
  • PostgreSQL Server 9.1 64-bit (installer: postgresql-9.1.8-1-windows-x64.exe)

After doing a bit searching, I found this link which contains the solution.

Here I will recap the solutions here:

Solution:

  • Uninstall PostgreSQL
  • Run command: net user postgres /delete
  • Click: Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from PostgreSQL installation.
  • Run: compmgmt.msc -> Click Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgrespass -> Create
  • Run: compmgmt.msc -> Click Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Administrators -> OK
  • copy the PostgreSQL installer postgresql-8.4.9-1-windows.exe to C:\
  • Run: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK

Voila! Installation completed successfully!

Advertisements

27 thoughts on “How To Solve “Problem running post install step…the Database Cluster Initialisation failed” on PostgreSQL Windows Installation

  1. ITS WORK.

    >runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe

    May be this way easier:
    Right click+Shift on postgresql-8.4.9-1-windows.exe-> Run as user-> Enter name: postgres, Password: postgrespass

  2. This might have been the most useful article I have ever read. Thank you so much. I can’t even begin to explain to you how useful this was for me.

    If you ever need anything, just let me know!

  3. P.S. Our company policy won’t allow postgrespass as the password, but I used one that it liked and the installation succeeded as reported. Thanx.

  4. When i try to create a new user it’s says that i have win home premium and that they can’t create new users that way. Pls help 😦

  5. OK FROM THIS PLACE, CAN YOU TELL IN ENGLISH ?? IN NORMAL HUMAN LANGUAGE ? Run: compmgmt.msc -> Click Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgrespass -> Create
    Run: compmgmt.msc -> Click Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Administrators -> OK
    copy the PostgreSQL installer postgresql-8.4.9-1-windows.exe to C:\
    Run: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
    Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
    Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK
    Because im not some hacker or nerd to understand this crap..
    what is compmngm. something ? how to run it ? where to find it ?

    • dude, you don’t have to be so hostile… It’s it’s pretty elementary… You type those commands in cmd(Command Prompt). And if you are super lazy and dumm to to that, you can just go to Control Panel —> Administrative Tools —> Computer Management instead of typing compmgmt.msc…

      Then you follow the instructions…

      How is this for an English? huh?

      • Thanks for your additional comment. I write this to audience which I expect to have certain level of understanding of how Windows work. In my opinion, if one will install PostgreSQL, it should be some experienced user 😛 which can understand what I write.

        Yet sorry I am a bit lazy to type more, my fault 😛

  6. Gracias, si Funciona.

    Busqué muchas maneras de poder arreglar ese problema, pero con tu solución al fin logre instalarlo. Tengo Windows 8.1 y funciona perfectamente

  7. Thanks. I was installing on an old Windows 2003 server (don’t ask!) and this worked for me although i ended up installing once, uninstalling, setting postgres as a user with full permissions for the postgresql directory which remained and then reinstalling.

  8. Follow this link solve issue on Windows Home Premium

    http://www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/

    I’ll keep this one short and sweet. For those of you that have tried to install PostgreSQL (mine was 8.3.7-1) on Windows Vista and got the error Database Cluster Initialisation Failed error at the end of the install, read this.

    The problem is that Vista has some safety features associated with setting permissions on the Program Files folder. Basically, even if you are an admin, you can’t change permissions on some folders like Program Files and Windows folder itself. This causes initdb to be unable to create some folders and the database cluster. What this means for you is that you need to install PostgreSQL in another folder that is not inside Program Files.

    By the way, if you have forgotten your Postgres account password while installing the first time, just open a Command Prompt in Vista (If you don’t know how, Google for it). Then type the command “net user”. You will see a list of users on your computer. Find Postgre’s account. It’s usually “postgres“. Then you need to change its password by typing “net user postgres new_password” where new_password is… well, a new password for the account. You will be needing that postgres account during install. You will need admin privileges to do this change however.

    Firstly, uninstall any failed installations. Use the Control Panel or the PostgreSQL installer in the install folder.

    During the install, you will be prompted to choose where you want to install the program. Just select a location in another place. Like “C:\PostgreSQL” or something similar. It may even be on your desktop. But not inside Program Files. Not inside Windows folder. However, it’s not as easy. Bear with me.

    After the install, you will still see that darned error message (or something like non-fatal error occured). Do not despair! (For Windows Power Users, we are just assigning Full Control permission to Postgres account on the new PostgreSQL install folder). For other users, read on if you don’t know how to do it.

    Go to where you just installed PostgreSQL. In this case, the C: drive. There, right-click on the folder (usually called PostgreSQL), and go to Properties – Security tab. Click on the Edit button. You will now see some usernames and other stuff. Click on the Add button. In the “Enter the object names to select” box, enter “postgres” and press Check. Postgres’ user account should appear there. Click on Ok.

    Now from the “Group or Usernames” box, select the Postgres account. In the window below, with lots of checkboxes, assign permission “Full Control” in the Allow Column to it. Note, if you don’t want to allow full control, just give it read/write. But I just went ahead and gave it Full Control. (I was tired and annoyed. The “World’s most advanced open source database” had failed to install!). Click on Ok and wait a bit for permissions to be applied.

    Then, just do a re-install. Do not uninstall anything. Just run the setup again. It’ll say that a PostgreSQL install folder already exists and other stuff. Just click on Next until the install finishes. If you see “file cannot be copied” errors, click on the “ignore” button when needed.

    That’s it. PostgreSQL should be up and running on Vista now. Hope it works for you too as it did for me, and that my guide is helpful to anybody. If it works, or if you have other solutions, let us know. Thanks for reading! 🙂

  9. Pingback: [PostgreSQL 9.5] Problem running post-install step – reservoir

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s