Problem running post install step postgresql windows 10

i got a new laptop from Dell(XPS 15), with Windows 10 Pro.
I have always the same issue During installation of postgres «Problem running post-install step. Installation may not complete correctly. The Database cluster initialisation failed.» .

i tried a lot of solutions of past threads:
Install postgres not into progam files
create a user named postgres with full access to postgress directory, explained here https://www.youtube.com/watch?v=pS_zWDDDSe0
Checked for new win-updates
Turned off Firewall and Antivirus of Windows.

Error running cscript //NoLogo «C:\develop\postgres/installer/server/initcluster.vbs» «NT AUTHORITY\NetworkService» «postgres» «****» «C:\develop\postgres» «C:\develop\postgres\data» 5432 «DEFAULT» 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
[14:03:49] Delete the temporary scripts directory…
Creating menu shortcuts…
Executing cscript //NoLogo «C:\develop\postgres\installer\server\createshortcuts_clt.vbs» «PostgreSQL 11» «C:\develop\postgres»
Script exit code: 0

EDIT ERROR LOG

Executing batch file 'radAD31B.bat'...
The program "postgres" was found by "C:/develop/postgres/bin/initdb.exe" but was not the same version as initdb.

asked Feb 11, 2019 at 13:14

Hades85's user avatar

Hades85Hades85

1031 gold badge1 silver badge10 bronze badges

1

I’ve just struggled with this for several hours, so I’m posting this for anyone else who winds up here.

Initially, all I could find were two bug reports on the pgsql-bugs mailing list:

BUG #15856: The program «postgres» was found by «initdb» but was not the same version as initdb.

BUG #15970: Db initialization error — initdb.exe and postgres not same version

The specific symptoms are:

The program "postgres" was found by ".../initdb.exe" but was not the same version as initdb.

and although the versions match, you get this:

C:\Program Files\PostgreSQL\11\bin>postgres -V
WARNING:  01000: could not determine encoding for locale
"<some encoding>.utf8": codeset is "CPutf8"

If these are your symptoms, the issue is that you have your region/language settings set to use UTF-8 (beta setting). This causes problems with lots of programs, and PostgreSQL is one of them. Disable this and re-install and you should be fine.

UTF8 Region Settings screenshot

answered Sep 11, 2019 at 22:52

simon's user avatar

simonsimon

15.4k5 gold badges45 silver badges67 bronze badges

1

If you ever changed the command line code encoding parameter in the registry

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun

to chcp 65001, chcp 1251 or any other, then that may be the issue.

Returning the value of the command line encoding registry value to default (empty) solved the problem in my case.

Try to change your registry value to empty:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun

answered Aug 11, 2021 at 6:43

Anton Kudryavtsev's user avatar

4

Follow these steps to avoid this error

  1. Uninstall PostgreSQL
  2. Delete if you have postgres user
  3. Right click on My Computer / This PC and click on Manage goto Local Users and Groups then Users New User enter Username as postgres and Password (whatever you want) and click on Create button.
  4. Now right click on postgres user and click on properties click on Member of tab and then on Add button here click on Advanced and a new dialog box open for Groups click on Find Now and select Administrators click OK button.
  5. Now open Command Prompt / cmd
  6. here type runas /user:postgres cmd.exe and hit enter
  7. cd path to downloaded Postgresql folder enter
  8. postgresql-x.x.x-x-windows.exe enter (here x reflect release, major and minor versions).
  9. Now repeat step 4 and remove group Administrators and add Power Users

answered Jul 15, 2020 at 4:24

Atif Zia's user avatar

Atif ZiaAtif Zia

7772 gold badges11 silver badges28 bronze badges

8

Just had this issue with postgres 12 my method to solve it is similar to Atif’s but uses the command line:

  1. Uninstall PostgreSQL

  2. Delete the postgres user if it still exists :

    net user postgres /delete

  3. Create the postgres user with a password you can remember:

    net user /add postgres [password]

  4. Add the postgres user to the Administrators group:

    net localgroup administrators postgres /add

  5. SKIP this as group no longer exists on win 10 and default users
    should have necessary permissions — Add the postgres user to the
    Power Users group

  6. Run a command window as the postgres user: (opens up new command
    window) :

    runas /user:postgres cmd.exe

  7. copy the install file to a location reachable by that user and run
    it e.g.:

    C:\Download\postgresql-12.4-1-windows-x64.exe

  8. Remove the postgres user from the Administrators group:

    net localgroup administrators postgres /delete

That’s it.
Hope this is useful

answered Sep 22, 2020 at 12:47

Andrew's user avatar

AndrewAndrew

2,60817 silver badges27 bronze badges

Just little addition to the answer from Anton Kudryavtsev:
Check that there is no Autoran parameter in registry: \HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor

Its’ deletion solved the error The program "postgres" was found by "C:/Program Files/PostgreSQL/14/bin/initdb.exe" but was not the same version as initdb in my case
(checked in Windows 10 x64 and Postgress 14.5 .exe installer)

answered Sep 13, 2022 at 11:15

Silentiy's user avatar

I have looked at the available solutions but none worked for me so I simply created a new user on my Windows 10 desktop and did the installation there and it was able to complete successfully.

answered Sep 16, 2020 at 12:50

sammyhawkrad's user avatar

Uninstallation may not remove all registry entries. You may type registry in the taskbar search and open Registry Editor.

Navigate to:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE

And remove entries pertaining to postgresql.

Toni's user avatar

Toni

1,5554 gold badges15 silver badges23 bronze badges

answered Sep 26, 2021 at 11:59

Satheesh's user avatar

Installing PostgreSQL on Windows with the EDB installer is begging to get bald(er) faster. You can run PostgreSQL on WSL (Windows Subsystem for Linux) and connect to it on Windows!

Open Windows Terminal/PowerShell as administrator (right click the start-icon on Windows 11 -> Windows Terminal (administrator). Type:

wsl --install

Reboot your computer. After login Ubuntu will automatically be installing, WSL2 and Ubuntu is standard on Windows 11 (check documentation on how to select a different distro, etc.) Follow the instructions to enter your desired username and password.

Update Ubuntu:

sudo apt update && sudo apt upgrade

Install PostgreSQL:

sudo apt install postgresql

Give the ‘postgres’ user a password:

sudo passwd postgres

Start the service and open psql shell:

sudo service postgresql start && sudo -u postgres psql

Notice that the password you created is not the DB password for postgres, so unless you create a new user you can give postgres one in the psql shell:

ALTER USER postgres PASSWORD 'mypw';

Now you can install pgAdmin or use your own program (in ‘normal’ Windows) to confirm that you can connect on 127.0.0.1 with port 5432 (may vary) with the user postgres and his password.

answered Oct 9, 2021 at 20:21

Same problem. Beta UTF-8 was not selected. However this gave me the idea.

I was trying to install using different locale than the default locale of the system I am using. Tried a couple of times.

Installed successfully using the default locale.

answered Nov 11, 2022 at 13:19

YavuzT's user avatar

You can refer to my method
I deleted the pgadmin folder in C:\Users\nameuser\AppData\Roaming and deleted the folder C:\Program Files\PostgreSQL
Then I uninstalled postgres and reinstalled.

enter image description here

answered Mar 18 at 8:43

antony tran's user avatar

One day, when I install PostgreSQL on Windows, it always report the following error:

Problem running the post-install step. Installation may not complete correctly.

… when the installation progress bar reached the end.

My configuration:

  • Windows 7 Professional 64-bit
  • PostgreSQL Server 9.1 64-bit (installer: postgresql-9.1.8-1-windows-x64.exe)

After doing a bit searching, I found this link which contains the solution.

Here I will recap the solutions here:

Solution:

  • Uninstall PostgreSQL
  • Run command: net user postgres /delete
  • Click: Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from PostgreSQL installation.
  • Run: compmgmt.msc -> Click Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgrespass -> Create
  • Run: compmgmt.msc -> Click Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Administrators -> OK
  • copy the PostgreSQL installer postgresql-8.4.9-1-windows.exe to C:\
  • Run: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK

Voila! Installation completed successfully!

  • Posted by in Database
  • Tagged: postgresql, windows
  • Uninstall PostgreSQL
  • Run command: net user postgres /delete
  • Click: Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from PostgreSQL installation.
  • Run command: net user postgres dbpass /add
  • Run: compmgmt.msc -> Click Local Users and Groups -> Users -> postgres ->Member of -> Add… -> Administrators -> OK
  • Run: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
  • Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK

Installation completed successfully! Enjoy

Start your headless eCommerce
now.
Read More

How to resolve problem running post-install step during PostgreSQL 10 installation

  1. During installation, ensure you select a locale other than the default, say English, United States.
  2. After the installation, execute the following commands from the command line:
initdb -D "C:\Program Files\PostgreSQL\10\data" -U postgres --locale="English_United States.1252"

pg_ctl register -N postgresql-x64-10 -D "C:\Program Files\PostgreSQL\10\data"

net start postgresql-x64-10

Everything should run smoothly onwards. You can check Windows list of Services to
verify that postgresql-x64-10 service is up and running

N.B: In case you run into issues with encoding, for example, you may get the error ‘ERROR: character with byte sequence 0xd9 0x90 in encoding «UTF8» has no equivalent in encoding «WIN1252»‘, execute the following SQL query:

update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '<the-database-name>';

While installing PostgreSQL I keep getting the message:

«Problem running post-install step. Installation may not complete
correctly The database cluster initialisation failed.»

This seems to prevent me from using PGadmin correctly.

In the install log I have found the following section which seems to indicate where things went wrong.

I haven’t been able to find a solution to this problem.

Executing batch file 'rad7C33E.bat'...
    The program "postgres" was found by "C:/Program Files/PostgreSQL/11/bin/initdb.exe"
but was not the same version as initdb.
Check your installation.

Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files\PostgreSQL\11/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\JesseDanckaarts\AppData\Local\Temp/postgresql_installer_6f373c7c91" "C:\Program Files\PostgreSQL\11" "C:\Program Files\PostgreSQL\11\data" 5432 "Dutch,Netherlands" 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
 The database cluster initialisation failed.
Executing icacls "C:\Users\JesseDanckaarts\AppData\Local\Temp/postgresql_installer_cb3c83cf49" /inheritance:r
Script exit code: 0

I have tried the following without luck so far:

  • https://wiki.postgresql.org/wiki/Running_%26_Installing_PostgreSQL_On_Native_Windows#Common_installation_errors
  • https://webkul.com/blog/postgresql-windows-installation-problem-running-post-install-step-installation-may-not-complete-correctly/
  • https://www.2ndquadrant.com/en/blog/postgresql-cluster-initialisation-failures-no-error-windows/

and many more!

If anyone knows what could be the problem I’d be very grateful!

asked Sep 2, 2019 at 14:56

Jesse's user avatar

5

Cross posting from StackOverflow:

I’ve just struggled with this for several hours, so I’m posting this for anyone else who winds up here.

Initially, all I could find were two bug reports on the pgsql-bugs mailing list:

BUG #15856: The program «postgres» was found by «initdb» but was not the same version as initdb.

BUG #15970: Db initialization error — initdb.exe and postgres not same version

The specific symptoms are:

The program "postgres" was found by ".../initdb.exe" but was not the same version as initdb.

and although the versions match, you get this:

C:\Program Files\PostgreSQL\11\bin>postgres -V
WARNING:  01000: could not determine encoding for locale
"<some encoding>.utf8": codeset is "CPutf8"

If these are your symptoms, the issue is that you have your region/language settings set to use UTF-8 (beta setting). This causes problems with lots of programs, and PostgreSQL is one of them. Disable this and re-install and you should be fine.

UTF8 Region Settings screenshot

answered Sep 11, 2019 at 22:55

simon's user avatar

simonsimon

1613 bronze badges

3

  • Profsvc что это за служба windows 10
  • Problem has been detected and windows has been shutdown to prevent damage to your computer
  • Profilic usb to serial comm port driver for windows 10
  • Product has non kms client channel skipped windows 10 что делать
  • Problem has been detected and windows has been shut down to prevent damage your computer