After some struggle I came across this post. I struggled some more time and I think I finally figured it out with the help of all the invaluable input from my predecessors in this post.
My case
- It's November 2018.
- PostgreSQL 11.1 Winodws-x64 from EnterpriseDB as suggested by postgresql.org
- Tried to install on Windows 10 (both Home and Professional)
I tried several constellations and boiled down the process to this:
Pre-installation
- Uninstall any failed installations.
- Add a local user "postgres" (lowercase worked for me) to your computer, assign a SIMPLE password and administrative rights. Do avoid special characters at all expenses, stick with english letters (upper and lowercase) and numbers only.
- Add a folder on your computer OUTSIDE the "C:\Program Files" or Windows folder. I chose C:\PostgreSQL
- Assign full control over the above folder to the postgres account.
Installation
- Run the installer (postgresql-11.1-1-windows-x64.exe in my case)
- use the above password and folder when prompted (not the default folder)
Post-installation
- For security reasons you should now assign a proper password to the windows-user "postgres" and remove administrative rights from the account.
- Test your installation by running pgAdmin and connecting to your server. However, the password for the postgres user you need to connect to the server will still be the simple one you used earlier. You may change it within pgAdmin by selecting the postgres database left, choose Tools -> Query Tool and type
ALTER USER postgres WITH PASSWORD '4wligzo748o$%&'; or whatever. Execute with the flash symbol or F5.
But maybe this is wrong altogether and you should rather run a linux vm with postgreSQL server.