Pg install: "The database cluster initialisation failed"

It appears that the root cause of this issue may have been that @Celeritas's computer had an incorrect value for the COMSPEC environment variable. It had a trailing semicolon, so instead of the normal:

C:\Windows\system32\cmd.exe

it was:

C:\Windows\system32\cmd.exe;

This one-character difference is enough. The above isn't a valid command prompt path, so popen() calls were failing. Unfortunately, instead of something useful like:

'"C:\Windows\system32\cmd.exe;"' is not recognized as an internal or external command, operable program or batch file

it instead reports the delightfully useful error No error:

initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error

See related:

  • http://forums.enterprisedb.com/posts/list/2125.page
  • http://postgresql.1045698.n5.nabble.com/initdb-failure-td2083455.html

I've reported this to the installer team and written a wiki entry to describe it. See blog post.

The issue was eventually resolved by:

  • Editing the COMSPEC environment variable
  • Uninstalling PostgreSQL
  • Rebooting
  • Reinstalling PostgreSQL

though there was a lot more before that which shouldn't actually be necessary to resolve this, including doing a total manual clean uninstall of PostgreSQL by hand.

Now I just want to find the people who wrote the program that modified this environment variable.