Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The installation proceeds most of the way without any issues.

At the end, I get an alert saying that there was a "Problem running post-install step. Installation may not complete correctly. The database cluster initialisation failed."

The install-postgresql.log file contains:

Executing cscript //NoLogo "C:\Program Files (x86)\PostgreSQL\9.1/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\Program Files (x86)\PostgreSQL\9.1" "C:\postgresql-data" 5432 "DEFAULT"
Script exit code: 1

Script output:
 WScript.Shell Initialized...
Scripting.FileSystemObject initialized...

WScript.Network initialized...
Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:6.1
    MajorVersion:6
Ensuring we can read the path C: (using icacls) to Krystian:
    Executing batch file 'rad8D950.bat'...
    Invalid parameter "Krystian:(RX)(NP)"

Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:6.1
    MajorVersion:6
Ensuring we can read the path C:\postgresql-data (using icacls) to Krystian:
Called IsVistaOrNewer()...
    'winmgmts' object initialized...
    Version:6.1
    MajorVersion:6
Ensuring we can write to the data directory (using icacls) to  Krystian:
Failed to ensure the data directory is accessible (C:\postgresql-data)
Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb

I tried the following variants: - installing 64bit PostgreSQL on Windows 7 64 bit - installing 32bit PostgreSQL on Windows 7 64 bit - creating a directory C:\postgresql-data\ and using it as the data dir to avoid storing data in Program Files

None of these options have worked. I cannot get it to install properly. I have a fairly new install of Windows 7 (less than 24 hours old).

I have seen post regarding this issue in many forums when I googled it. However, no resolutions worked for me.

Has anyone experienced this exact issue and been able to resolve it? If so, please share your wonderful answer.

share|improve this question

closed as off topic by random Feb 25 '12 at 21:41

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Likely duplicate of serverfault.com/questions/363771/… –  uSlackr Feb 25 '12 at 21:03

1 Answer 1

up vote 0 down vote accepted

I have found an acceptable solution:

http://forums.enterprisedb.com/posts/list/1891.page

Please see the answer by Sampath+Rachakonda.

The short answer is that you cannot install Postgresql to a directory inside of Program Files.

The solution is to do an install to, say C:\Postgresql\. After the install, you will get the same error. After the install, empty out the C:\Postgresql\ and set its permission to allow the postgres user full control (or give it full ownership). Do the install again. All should work well.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.