问题
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.
回答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.
来源:https://stackoverflow.com/questions/54631443/win-10-postgresql-11-database-cluster-initialisation-failed