postgresql installation failed

Viewed 82698

I tried to install postgresql 8.4 in my windows 7 (64 bit). But it fails with following messages in log

Initialising the database cluster (this may take a few minutes)...
Executing cscript //NoLogo "C:\PostgreSQL\8.4/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\PostgreSQL\8.4" "C:\PostgreSQL\data" 5432 "DEFAULT"
Script exit code: 1

Script output:
 CScript Error: Can't find script engine "VBScript" for script "C:\PostgreSQL\8.4\installer\server\initcluster.vbs".

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\PostgreSQL\8.4/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\PostgreSQL\8.4" "C:\PostgreSQL\data" 5432 "DEFAULT" : Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
 The database cluster initialisation failed.
Creating Uninstaller
Creating uninstaller 25%
Creating uninstaller 50%
Creating uninstaller 75%

I have googled about this and run the command 'regsvr32 vbscript.dll' and it shows the message 'DllRegisterServer in vbscript.dll is succeeded', but it haven't solved my issue.

Also I set the default value for {B54F3741-5B07-11cf-A4B0-00AA004A55E8} in registry to the file path of vbscript.dll, but it also haven't solved my issue.

How to fix this issue?

21 Answers

This message still occurs in Postgres v9.3.1.1.

For me, the problem was running the installer under the "Administrator" account. This doesn't work. Run it under an administrator account, avoiding the built-in "Administrator" account.

I don't really know what it's usually called, but it's the one that already exists on a fresh install; the one that cannot be changed to a Standard User; the one whose profile is stored in C:\Users\Administrator. Turns out it was a bad idea using this account; learned it the hard way.

(Windows Server 2008 R2 64-bit)

There seem to be many reasons cause the installation fail.

In my case, I'm using Windows 10 home edition, which has no advance user group control, so a lot of solutions above doesn't work for me. And I guess this is why the installation fails.

What I do is just using BigSQL's installer instead of EnterpriceDB's installer,

Choose the second installer in posgresql download center

Or visit BigSQL directly.

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.

Struggling with this problem for days. Finally got help from the EDB team My problem got solved by doing the following steps :

1) Open the command prompt and go to the following directory:

cd "C:\Program Files\PostgreSQL\10\bin"

2) Once you are inside this "C:\Program Files\PostgreSQL\10\bin" directory execute the following command:

.\initdb.exe -D "C:\Program Files\PostgreSQL\10\data"

3) At the end of this command you will be promoted to execute a pg_ctl command to start the Postgres cluster. Please execute the command and once you get a message as the server started you are all set to use the Postgres database.

Note: Instead of 10 user whatever version you have installed. If the pg_ctl command in the third step gives an error after running it in \bin directory, then try running it in \data directory. After the above process re-run the installer.

I had the same problem today when installing postgres 9.6.19 on windows 10. Solution: Neither the installation path nor the windows path variable may contain a blank! Near to the end of the installer log file (found in wondows %temp% dir with a name like bitrock_installer_16156.log) i found:

Script stderr: "\UnxUtils\usr\local\wbin\";"C:\Program" kann syntaktisch an dieser Stelle nicht verarbeitet werden.

where the installation directory i set as well as my windows %PATH% variable contained

C:\Program Files\

Workaround: open a command prompt as administrator and type:

set path=C:\WINDOWS\system32
PostgreSQL-9.6.10-1-win64-bigsql.exe

And then of course choose a path not containing a blank. That did it for me.

I encountered an issue where a username with a space in it on windows fails the postgres installation.

To test:

  • Reinstalled windows 10 home (restored)
  • Made a user account without the space
  • Postgres installed successfully

Very frustrating...

  1. check the services: if any folder there postgres related stop it, and change to disable mode.
  2. check regedit: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER -> software -> remove postgres folder if exists.
  3. In system environment variable: TEMP path location, remove the TEMP folder for both user and system. and Rename the TEMP to TEMP1 or something..
  4. In system environment variable: remove path for postgres if it exists.
  5. Now change the location of postgres.exe file to another drive.
  6. Restart the system
  7. Then Run postgres.exe
  8. create a new installation directory for postgres and put /data outside.

the easiest way i solve this was:

1.- uninstall if you have already installed

2.- delete all files with failed instalations

3.- start windows in secure mode

4.- run installer in secure mode (it pops a warning but ignore) and restart

and that's it when restarted the service was running ok and everything works fine

Related