I've seen many solutions and have been working on this issue for hours now.

After installation the post-installation script fails with the message above.

This is a development installation of EnterpriseDB On Windows 10 Pro (German Edition with English language pack).

  • No user created

  • No service created

  • No initialization happened

What I read about and tried without success (I hope I don't forget anything, as far as I remember these are all (at least most) solutions I tried posts from up to 10 years ago):

  • Checked whole file system privileges up to root of C:\, I have no other drive - this is a dev laptop.

  • Installed different locales because I read there could be issues. I tried "default", "C", "US English"

  • COMSPEC and other ENVs are correct, no trailing semicolon or other disturbances.

  • postgres password is simple

The installation works perfectly on a different laptop.

What I observed:

This issue is caused by a failing objShell.Run call in the VBS script.

The call is simply not executed. No error message. It "looks like" objShell.Run is called, seems to fail somehow and the DoCmd function where it is called returns. I don't even get a return value from objShell.Run, it just jumps out of DoCmd, thats it.

The written batch file exists. The path variables in the VBS are correct. The log file created inside the batch file is not created therefore I think it is not called at all. But it is created when I prevent the batch file from being deleted and calling it manually from command line. I prefixed the objShell.Run with "cmd /c " which caused it to run "more" but kept on getting other errors.

Unfortunately after several reinstalls, tries, reboots and so on I don't have the logs anymore. But if it is required for problem solving I'd be happy to provide it tomorrow.

I need to say I am not familiar with VBS but that is how far I was able to debug it. I also tried /X /D but I think i need deprecated tools for debugging, do I?

I spent hours with this problem and I'll leave it for today but I'm in desperate need for help.


(edit 1) Added which binary distribution


There are two Windows binary packages available for download from the PostgreSQL site: one by BigSQL and one by EDB.

You don't tell us which one you tried, but my advice is to give up on the one that you are using and try the other one.

| improve this answer | |
  • I should have told that I tried EnterpriseDB. When you are on the postgres website and just follow links to the Windows binary this is the only one available. I haven't tried 3rd party but this would be the next step. EnterpriseDB seems to be the official windows distribution, at least the website looks like that to me. – Silberling Jun 13 '19 at 8:28
  • The windows downloads of BigSQL have "Deprecated" in the page title. Looks like they're dumping Windows and Mac downloads. – Silberling Jun 13 '19 at 8:34
  • 2ndquadrant - initdb: too many command-line arguments. Different error, same result. - I am pretty sure - as the EnterpriseDB installations work fine on a different device, nearly same config - That there is an issue with my windows on this machine but I can't figure out what. I'm going to use the ZIP from EnterpriseDB and set it up myself. But for our other devs I'd like to find a "proper" solution for the EnterpriseDB Setup. – Silberling Jun 13 '19 at 9:09
  • Hard luck. Try to find a log that tells you what exactly went wrong. Maybe switch to Linux, where life is easier. – Laurenz Albe Jun 13 '19 at 11:05
  • Unfortunately I can't switch to Linux on my work notebook. I installed postgres myself using the EDB zip, initialized it and installed it as service. The logs (EDB) did not help, thats why I stated debugging the VBS with the result above. – Silberling Jun 14 '19 at 9:22

The fix for this as I have faced this all weekend.
The installation Directory lets say its C:\Program Files\PostgreSQL Make sure that the Data Directory is C:\PostgreSQL\12\data

This fixed that problem for me.

| improve this answer | |
  • This is definitely not a solution. It just works by accident. I am facing this problem since Postgres versions back to 9.2. On some Windows machines the initdb works perfectly, on others it fails. The usual solution mostly is "Use a different user account for installation" The Windows initdb programmers obviously heavily mess around with user permissions, which makes to operation fail on some systems. – fefewe Feb 19 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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