4

Hello i am 2 days stuck trying to install POSTGRE SQL. Today it is on version 16 but already attempted versions 14, 13, 15....

It looks like the bin\data folder, which is the db cluster folder, has some kind of structure and on the end of installation i get a POP UP , indicating that the folder setup for the db clusters was not configured right.

I am installing this because i need to run a django project.

This log i got from C:\Program Files\PostgreSQL\16\installation_summary.log:

Processados com sucesso 1 arquivos; falha no processamento de 0 arquivos

Called IsVistaOrNewer()... 'winmgmts' object initialized... Version:10. MajorVersion:10 Granting full access to Administrators on (C:\PostgreSQL\data)

Executing batch file 'rad30F8E.bat'... arquivo processado: C:\PostgreSQL\data Processados com sucesso 1 arquivos; falha no processamento de 0 arquivos

Executing batch file 'rad30F8E.bat'... processo filho terminou com c¢digo de sa¡da 1 initdb: erro: O programa "postgres" ‚ requerido pelo initdb mas nÆo foi encontrado no mesmo diret¢rio que "C:/Program Files/PostgreSQL/16/bin/initdb.exe"

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 C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\16/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\Administrador\AppData\Local\Temp/postgresql_installer_afbe97298d" "C:\Program Files\PostgreSQL\16" "C:\PostgreSQL\data" 5432 "Portuguese,Brazil" 0: Program ended with an error exit code Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed. Setting variable whoami from C:\WINDOWS\System32\whoami Script exit code: 0

Script output: desktop-peu5949\administrador

When it finishes installing i don't get a windows service of the postgreSQL

error

Attempted:

Solution1

Solution2

Solution3

5
  • 3
    There is almost certainly an earlier error if the "postgres" executable can't be found. Or perhaps it is there but you don't have permission to execute it for some reason (which will depend on how your Windows machine is administered) Commented Nov 15, 2023 at 10:07
  • What installer do you use? Commented Nov 15, 2023 at 14:53
  • I use The normal installer from The oficial website postgre SQL 16 Windows, 86-64x. I am using Windows 10 64 bits. Already tryed changing installer location but Will try more. You think my Windows permissions are messed? @RichardHuxton Commented Nov 15, 2023 at 17:31
  • There's no easy way to diagnose Windows permissions problems in a forum @AugustoCamargo - I'm afraid the permissions model there is more complex than a typical unix-derived setup. Commented Nov 15, 2023 at 18:44
  • @RichardHuxton, however i had postgreSQL runnning on this machine before.... I uninstalled it and then the problems started showing Commented Nov 15, 2023 at 19:53

2 Answers 2

10

After hours of struggle, the following method was the solution for me. I used this link for the solution:

PostgreSql "running post install step…the Database Cluster Initialisation failed"

-- to create and run Postgresql database settings after installation :

"C:\Program Files\PostgreSQL\16\initdb.exe" -D "C:\Program Files\PostgreSQL\16\data" -U postgres --locale="English_United States.1252"

-- to create and run the Postgresql service:

"D:\PostgreSQL\16\bin\pg_ctl.exe" register -N postgresql-x64-16 -D "D:\PostgreSQL\16\bin\data"

There are a few details that I would like to draw attention to: My local computer has the settings Turkish_Turkey.1254. This is exactly how my previous Postgres installations were configured.

The problem seems to be related to windows update or EnterpriseDB deployment settings. However, I am not sure which one exactly caused this error.

The two lines above did exactly what I needed when I ran them from the command line (with administrator rights)

Sign up to request clarification or add additional context in comments.

3 Comments

setting --locale for initdb has solved my problem. Seems like postgres 16 fails at The Turkey Test :)
when I use initdb, i get the following error: The system cannot find the path specified. child process exited with exit code 1 initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "c:/Program Files/PostgreSQL/16/bin/initdb" despite postgres.exe is right there in the same folder what am I missing?
With the latest Windows update, Microsoft changed the name of local settings from Turkish_Turkey.1254 to Turkish_Türkiye.1254. It seems that Postgresql couldn't recognize this new name.
0

After the first installation failed, I tried to install again, but this time I selected "English — United States" as language. And also change data directory to new file "postgres data" on Desktop. It worked. But still had to add paths for psql.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.