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!
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
i followed urs procedure but i am getting this error.it said wrong password or user name.i enterd username:postgres and password:postgrespass
Try to copy paste istead type it manually to prevent miss typing
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!
Great to hear that!
didn’t work for me
thanks! finally I found the solution
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.
Worked like a charm! Thank you!
You’re welcome!
Thank-you! This also works for the 9.2.5.1 windows x64 install as well. I cannot express my gratitude enough!
Glad to see that this post help you all!
Thank you, it really solved the problem when installing it
I followed all the step, but nor working
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 😦
Ooops sorry I didn’t use WIndows Home Premium… Good luck
It works! Thanks to all involved with this solution!
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 😛
This has also worked for Windows 2012 Server. Many thanx !
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
THANK YOU man… very helpful… 🙂 (y)
You’re welcome!
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.
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! 🙂
Pingback: [PostgreSQL 9.5] Problem running post-install step – reservoir
when trying to run postgresql-8… the response is postgresql-8… is not recognized as internal or external command
Thank you very much.
Me ayudo muchisimo, si lo siguen al pie de la letra les funcionara a la perfeccion.
This solution is not working on Windows 2008.
The requested operation requires elevation – during setup execution.
it just worked for me on windows 2008
Je sollicite votre appui. J’essaye d’installer PostGreSQL en local sur mon poste (Windows 8). Voici le message qui s’affiche: problem running post-install step. installation may not complete correctly. Error reading file C:/PostgreSQL/9.3/data/postgreql.conf
why I cant delete the user account that may be lefted by postgres named“USER-20180521XX\Administrator”
when doing the step:lick: Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from PostgreSQL installation.
comment from2019, this solution still works!