При инициализации базы данных произошла ошибка postgresql установка

I’ve pulled shin’s link from the google cache:

Original link:
http://www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/

Cached link:
http://webcache.googleusercontent.com/search?q=cache:RXu-5-ZzfcgJ:www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/+&cd=3&hl=ro&ct=clnk


PostgreSQL Database Cluster Initialisation Failed Solution

I’ll keep this one short and sweet. For those of you that have tried to install PostgreSQL (mine was 8.3.7-1) on Windows Vista and got the error Database Cluster Initialisation Failed error at the end of the install, read this.

The problem is that Vista has some safety features associated with setting permissions on the Program Files folder. Basically, even if you are an admin, you can’t change permissions on some folders like Program Files and Windows folder itself. This causes initdb to be unable to create some folders and the database cluster. What this means for you is that you need to install PostgreSQL in another folder that is not inside Program Files.

By the way, if you have forgotten your Postgres account password while installing the first time, just open a Command Prompt in Vista (If you don’t know how, Google for it). Then type the command “net user”. You will see a list of users on your computer. Find Postgre’s account. It’s usually “postgres“. Then you need to change its password by typing “net user postgres new_password” where new_password is… well, a new password for the account. You will be needing that postgres account during install. You will need admin privileges to do this change however.

Firstly, uninstall any failed installations. Use the Control Panel or the PostgreSQL installer in the install folder.

During the install, you will be prompted to choose where you want to install the program. Just select a location in another place. Like “C:\PostgreSQL” or something similar. It may even be on your desktop. But not inside Program Files. Not inside Windows folder. However, it’s not as easy. Bear with me.

After the install, you will still see that darned error message (or something like non-fatal error occured). Do not despair! (For Windows Power Users, we are just assigning Full Control permission to Postgres account on the new PostgreSQL install folder). For other users, read on if you don’t know how to do it.

Go to where you just installed PostgreSQL. In this case, the C: drive. There, right-click on the folder (usually called PostgreSQL), and go to Properties – Security tab. Click on the Edit button. You will now see some usernames and other stuff. Click on the Add button. In the “Enter the object names to select” box, enter “postgres” and press Check. Postgres’ user account should appear there. Click on Ok.

Now from the “Group or Usernames” box, select the Postgres account. In the window below, with lots of checkboxes, assign permission “Full Control” in the Allow Column to it. Note, if you don’t want to allow full control, just give it read/write. But I just went ahead and gave it Full Control. (I was tired and annoyed. The “World’s most advanced open source database” had failed to install!). Click on Ok and wait a bit for permissions to be applied.

Then, just do a re-install. Do not uninstall anything. Just run the setup again. It’ll say that a PostgreSQL install folder already exists and other stuff. Just click on Next until the install finishes. If you see “file cannot be copied” errors, click on the “ignore” button when needed.

That’s it. PostgreSQL should be up and running on Vista now. Hope it works for you too as it did for me, and that my guide is helpful to anybody. If it works, or if you have other solutions, let us know. Thanks for reading!

Не могу установить Postgresql. Все перепробовала:

  • Я запускаю установку как администратор.
  • Я создаю пользователя postgresql и добавляю его в группу администраторов.
  • Я устанавливаю его прямо на C: postgresql.

Но безуспешно. для информации: у меня windows 8

12 ответов

Лучший ответ

  • Прежде всего запустите настройку от имени администратора.
  • Выберите папку для установки внутри программных файлов (по умолчанию)
  • Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)


5

ISONecroMAn
21 Фев 2016 в 10:16

Другой способ решить эту проблему — изменить регион (язык) вашей операционной системы (Машины). Если вы выбираете, например, французский, возьмите французский из Франции, а не местный французский. То же самое для английского, а не местного английского. Некоторые символы не работают с местным языком. Думаю, это решит вашу проблему.


0

Y4glory
14 Июл 2020 в 21:13

Для меня это терпело неудачу каждый раз и для каждого решения, упомянутого здесь. Затем, после небольших собственных исследований и разработок, я смог успешно использовать postgresql. Ниже приведены шаги, которые необходимо выполнить при обнаружении этой ошибки «сбой при инициализации кластера базы данных».

Вы должны вручную запустить initdb, который присутствует: «C: Software PostgreSql 12 bin»

Теперь убедитесь, что вы связали «postgres» как пользователя с командой initdb, поскольку «postgres» — это суперпользователь, созданный во время установки.

initdb -D «D: PostgreSql 12 data» -U postgres

Теперь, когда кластер базы данных инициализирован, вы можете запустить сервер с помощью утилиты pg_ctl, находящейся в папке bin PostgreSql 12.

pg_ctl start -D «D: PostgreSql 12 data»

Или вы также можете зарегистрировать его как службу Windows, и вы можете установить его на автоматический

pg_ctl register -N PostgreSql-12.3.1 -D «D: PostgreSql 12 data»

Теперь вы готовы к использованию базы данных postgresql. Либо используйте его через строку cmd (psql), либо pgAdmin4


0

Abhilaksh Sharma
6 Июл 2020 в 20:25

Я пытался и терпел неудачу несколько раз, думая, что это как-то связано с правами и пользователем, которые использовались во время установки. Но благодаря совету ThangLeQuoc по проверке журнала установки я нашел причину:

initdb: недопустимое имя локали «NorwegianBokm † l, Norway»

Вызывается Die (не удалось инициализировать кластер базы данных с помощью initdb) …

Не удалось инициализировать кластер базы данных с помощью initdb

Итак, после выбора «локали по умолчанию» в процессе установки все прошло нормально. Это было в версии 11.6 OS Postgres.


0

Community
20 Июн 2020 в 09:12

Я выполнил шаги, предложенные @IsoNecroMad, и это сработало

1) Прежде всего, запустите настройку от имени администратора.

2) Выберите папку для установки внутри программных файлов (по умолчанию)

3) Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)


0

umang-malhotra
19 Авг 2019 в 12:39

Возможное решение для 10.3. версия:

  1. Загрузить установочный файл PostgreSQL

  2. Переместите загруженный файл на диск C: .
    Пример: C:postgresql-10.3-2-windows-x64.exe

  3. Создайте каталог с именем PostgreSQL на диске C:

  4. Создайте каталог с именем 10 в ранее созданном каталоге PostgreSQL.
    Итак, вам нужно иметь C: PostgreSQL 10 .

  5. Запустите C: postgresql-10.3-2-windows-x64.exe (НЕ НАЖИМАЙТЕ «ЗАПУСТИТЬ ОТ АДМИНИСТРАТОРА», просто дважды щелкните)

  6. Измените путь к каталогу установки на C:PostgreSQL

  7. Измените путь к каталогу данных на C:PostgreSQLdata

  8. финиш

Надеюсь, установка пройдет успешно.


0

Spectarion
11 Апр 2018 в 20:19

Задача решена:

Запустите установку от имени администратора и используйте режим Windows 7


0

xAminex
10 Сен 2015 в 12:22

Я столкнулся с той же проблемой при попытке установить postgres 10.3. Запуск от имени администратора мне не помог. Но он был установлен правильно, когда я изменил каталог установки с каталога по умолчанию, который находится внутри Program Files. Вместо этого я создал новую папку на диске C и сделал ее каталогом установки.


1

Shamil Puthukkot
4 Мар 2019 в 05:09

Я устанавливал Postgres версии 9.5 (в Windows 7 и с помощью установщика DBEnterprise) … для меня проблема, похоже, в том, что я выбирал «POSIX» в качестве региональной конфигурации … Но я пробовал с региональной конфигурацией «C» Настройка и установка завершились без проблем …

Также я запускаю установщик от имени администратора!


1

Carlitos Way
16 Май 2016 в 22:54

Только не используйте установщик EDB. Сейчас есть альтернатива BigSQL.


2

Basil
21 Авг 2016 в 17:53

Сейчас 2019 , и у меня все еще та же проблема с Postgres 11 . Перед этим я удаляю текущий Postgres 9.6 (если я правильно помню версию) и пытаюсь установить новый Postgres 11, и возникает проблема. Я пробовал следующие подходы, но ни один из них не работает:

  • Запускать установку от имени администратора при каждом запуске -> сбой
  • Выберите папку для установки по умолчанию, предложенную при установке (C: / Program Files / PostgresSQL / 11), и папку данных, расположенную в другом
    место -> не удалось
  • Установить его за пределами C: / -> все равно не удалось

Единственный подход, который я, к счастью, нашел, почесав голову почти весь день, — это сообщение
Я хотел бы быстро резюмировать решение, если срок действия ссылки истек.

Решение :
— Удалите PostgreSQL
— CMD: net user postgres / delete
— Панель управления -> Учетные записи пользователей -> Настроить дополнительные свойства профиля пользователя -> удалить все экземпляры «Неизвестного пользователя», которые кажутся оставшимися от postgres
— Выполнить> compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> Новый пользователь … -> Имя пользователя: postgres, Пароль: postgres -> Создать
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Добавить … -> Администраторы -> ОК
— скопируйте postgresql-8.4.9-1-windows.exe в C:
— runas / user: postgres cmd.exe -> cd -> postgresql-8.4.9-1-windows.exe -> успешно установлен без ошибок. Папка с проверенными данными и подтвержденные файлы созданы успешно. (это означает, что вы должны запустить установку с созданным пользователем postgres )
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Администраторы -> Удалить
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Добавить … -> Опытные пользователи -> ОК
— Установлен HM2 -> БД успешно создана
— Перезагрузка компьютера -> HM2 работает правильно (т.е. просто для проверки автоматического запуска службы postgresql)

Советы профессионалов: Чтобы получить представление о журнале установки, перейдите на % TEMP%, выполнив поиск по запросу «% TEMP%» на панели задач, имя журнала будет bitrock_installer-xxx.log. Вы хотели бы знать, что происходит, чтобы быстрее устранить проблему.


6

ThangLeQuoc
13 Янв 2019 в 17:14

I can’t install Postgresql. I’ve tried everything:

  • I run the setup as Administrator.
  • I create a postgresql user an I add it to the Administrator group.
  • I install it directly on C:postgresql.

but without any success.
for information: I have windows 8

miken32's user avatar

miken32

41.4k16 gold badges111 silver badges152 bronze badges

asked Sep 8, 2015 at 8:58

xAminex's user avatar

2

  • First of all run the set-up as administrator.
  • Choose the installation folder inside program files( default)
  • But chose your data location outside from above folder to somewhere
    else ( c:postgres data or something.)

answered Feb 21, 2016 at 10:16

ISONecroMAn's user avatar

ISONecroMAnISONecroMAn

1,4622 gold badges16 silver badges22 bronze badges

it’s 2019, and I still have the same issue with Postgres 11. Before that, I remove the current Postgres 9.6 (if I remember the version correctly), and attempt to install the new one Postgres 11, and got the issue. I have try these following approaches, but none of them work:

  • Run installation as Administrator on every run -> failed
  • Choose the default installation folder that the setup prompted (C:/Program Files/PostgresSQL/11), and the data folder reside at other
    place -> failed
  • Install it on a place outside C:/ -> still failed

The only approach that I luckily found after scratching my head nearly the whole day is with this post
I would like to quickly recap the solution in case the the link expired

Solution:
— Uninstall PostgreSQL
— CMD: net user postgres /delete
— Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all «Unknown User» instances that seem to be left from postgres
— Run > compmgmt.msc -> Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgres -> Create
— compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Administrators -> OK
— copy postgresql-8.4.9-1-windows.exe to C:
— 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. (this mean you must run the installation with the created postgres user)
— compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
— compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK
— Installed HM2 -> created db successfully
— Restarted computer -> HM2 runs properly (i.e. just to check postgresql service starts automatically)

Pro Tips:
To get an insight of the installation log, go to %TEMP% folder by searching for «%TEMP%» in the task bar, the log name would be bitrock_installer-xxx.log. You would want to know what is going on to troubleshoot the issue faster.

answered Jan 13, 2019 at 17:14

ThangLeQuoc's user avatar

ThangLeQuocThangLeQuoc

2,0321 gold badge17 silver badges28 bronze badges

0

For me it failed every time and for every solution mentioned here. Then after doing a little R&D of my own I was able to successfully use postgresql. Below mentioned are the steps to be followed when you encounter this error «the database cluster initialisation failed»

You have to mannualy run initdb which is present : «C:SoftwarePostgreSql12bin»

Now make sure u associate «postgres» as user alongwith the initdb cmd since «postgres» is the superuser that got created during installation.

initdb -D «D:PostgreSql12data» -U postgres

Now once database cluster is initialized then you can start the server by using pg_ctl utility present inside bin folder of PostgreSql12

pg_ctl start -D «D:PostgreSql12data»

Or you can also register it as a windows service and you can set it to automatic

pg_ctl register -N PostgreSql-12.3.1 -D «D:PostgreSql12data»

Now you are all set to use the postgresql database.
Either use it through cmd line (psql) or pgAdmin4

answered Jul 6, 2020 at 20:25

ALS's user avatar

ALSALS

2982 silver badges7 bronze badges

Just don’t use EDB installer. There is BigSQL alternative now.

answered Aug 21, 2016 at 17:53

Basil's user avatar

BasilBasil

2,6001 gold badge9 silver badges4 bronze badges

0

I was installing the Postgres version 9.5 (On windows 7 and using the DBEnterprise installer)… for me, the problem seems to be that I was selecting «POSIX» as Regional Configuration… But I tried with the «C» Regional Configuration, and the installation finished without any problem…

Also, I run the installer as Administrator!

answered May 16, 2016 at 22:54

Carlitos Way's user avatar

Carlitos WayCarlitos Way

3,21921 silver badges28 bronze badges

0

I was facing the same issue on trying to install postgres 10.3.Running as the administrator didn’t help me. But it got installed properly when i changed the installation directory from the default one which is inside Program Files.Instead i created a new folder inside the C drive and made it the installation directory.

answered Mar 4, 2019 at 5:09

Shamil Puthukkot's user avatar

Problem solved:

run the setup as Administrador and use Windows 7 mode

answered Sep 10, 2015 at 12:22

xAminex's user avatar

xAminexxAminex

3632 gold badges6 silver badges18 bronze badges

Possible solution for 10.3. version:

  1. Download PostgreSQL installation file

  2. Move downloaded file to C: drive.
    Example: C:postgresql-10.3-2-windows-x64.exe

  3. Create directory named PostgreSQL in C: drive

  4. Create directory named 10 in previously created PostgreSQL directory.
    So you need to have C:PostgreSQL10.

  5. Run C:postgresql-10.3-2-windows-x64.exe (DO NOT CLICK ON ‘RUN AS ADMIN’, just double click)

  6. Change installation directory path to C:PostgreSQL

  7. Change data directory path to C:PostgreSQLdata

  8. Finish

Hopefully, installation should be successful.

answered Apr 11, 2018 at 20:19

Anis Alibegić's user avatar

Anis AlibegićAnis Alibegić

2,7663 gold badges14 silver badges28 bronze badges

I followed steps suggested by @IsoNecroMad and it worked

1) First of all, run the set-up as administrator.

2) Choose the installation folder inside program files( default)

3) But chose your data location outside from above folder to somewhere else ( c:postgres data or something.)

answered Aug 19, 2019 at 12:39

umang-malhotra's user avatar

I tried and failed several times thinking it was somthing to do with rights and user used during the installation. But thanks to ThangLeQuoc’s pro tip to inspect the installation log I found the cause:

initdb: invalid locale name «NorwegianBokm†l,Norway»

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

Failed to initialise the database cluster with initdb

So after selecting ‘default locale’ during the installation process it all went fine.
This was on version 11.6 os Postgres.

Community's user avatar

answered Feb 12, 2020 at 7:25

superodde's user avatar

superoddesuperodde

1311 silver badge3 bronze badges

Another way to solve this problem is to change the region (language) of your operating system (Machine).
If you choose for example French, take French from France and not local French. Same for English, not local English. Some characters do not work with the local language.
I think it will resolve your problem.

Y4glory's user avatar

Y4glory

1,1016 silver badges17 bronze badges

answered Jul 14, 2020 at 16:33

Amandine's user avatar

It is 2021 and I had the error message with PostgreSQL 13 (and the official EDB installer): «Problem running post-install step. Installation may not complete correctly. The database cluster initialization failed.»

The reason was that I tried to install PostgreSQL on an USB Stick
formatted with FAT32 (I just wanted to try it, not use it for important
data). While it is possible to store the programs on the USB stick (573 MB),
the data directory had to be on the internal disk formatted with NTFS.
I tried to use initdb directly (on the USB stick) and there were error messages that it could not create links. This probably explains why the FAT32 format is not possible for the data directory.

answered Feb 6, 2021 at 11:15

StefanB's user avatar

StefanBStefanB

791 silver badge3 bronze badges

I had the same issue with PostgreSQL 13.4 on Windows and the problem was that the post install script, initcluster.vbs, was being run without the last parameter. I had copied the command from the install-postgresql.log file and tried to run it in a command window and received the following message:

Usage: initcluster.vbs <OSUsername> <SuperUsername> <Password> <PasswordDir> <Install dir> <Data dir> <Port> <Locale> <CheckACL>

I looked at the command I had tried to run and it was missing the <CheckACL> parameter altogether. I retried the command adding true as the last parameter and it ran successfully. After completing the script I ran the following command from the c:Program FilesPostgreSQL13bin folder:

pg_ctl register -N PostgreSql-13.4 -D «<my data directory>»

This registered it as an automatic start service. I went to the Windows Services app and started it. After that I was able to use pgAdmin 4 to connect.

answered Sep 10, 2021 at 2:46

HisDivineShadow's user avatar

HisDivineShadowHisDivineShadow

1,0061 gold badge12 silver badges20 bronze badges

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. 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:37

!!!
You needn’t to install it in any special place

if you meet this problem, try:
1, not set the data folder besides the root folder,although it is the default
2, check your antivirous software, like 360.

answered Feb 24, 2022 at 7:23

zephms's user avatar

1

При инициализации БД выдает след. ошибку

postgres@1csrv:/usr/LOCAL/pgsql/bin$ ./initdb -D /DATA
The files belonging TO this DATABASE system will be owned BY user "postgres".
This user must also own the server process.
 
The DATABASE cluster will be initialized WITH locale C.
The DEFAULT DATABASE encoding has accordingly been SET TO SQL_ASCII.
The DEFAULT text search configuration will be SET TO "english".
 
fixing permissions ON existing directory /DATA ... ok
creating subdirectories ... ok
selecting DEFAULT max_connections ... 100
selecting DEFAULT shared_buffers ... 32MB
creating configuration files ... ok
creating template1 DATABASE IN /DATA/base/1 ... ok
initializing pg_authid ... FATAL:  syntax error at OR near "REVOKE" at character 1
STATEMENT:  REVOKE ALL ON pg_authid FROM public;
 
child process exited WITH exit code 1
initdb: removing contents of DATA directory "/DATA"
postgres@1csrv:/usr/LOCAL/pgsql/bin$ 

ОС Slackware 13.37, Postgresql 9.0.3.
Исходники и патчи брал с сайта 1С. Скомпилировалась и установилаь без ошибок.
Подскажите где посмотреть?

(Note: This question has been compeltely rewritten from its original form, so it reflects the actual problem and will help others find a solution to the same issue).


I still haven’t been able to successfully install PostgreSQL on my Windows 7 Ultimate x64 computer. See this prior question for some history.

I did a fresh instillation of 9.2 and the only error I got was this one:

error installing

It reads:

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

This occurs even after I do a complete manual uninstall of PostgreSQL and pgAmdin-III:

  • Ran the PostgreSQL uninstaller, which failed with the error Error stopping service postgresql-x64-9.2.
  • Removed all the PostgreSQL-related registry entries for PostgreSQL under HKEY_LOCAL_MACHINESOFTWARE and HKEY_CURRENT_USERSOFTWARE
  • Removed the postgres user account using net user postgres /delete in an Administrator command prompt (shift-right clicked on «Command Prompt» in start menu, chose «Run as administrator»)
  • Removed the postgres user profile
  • Deleted the C:Program FilesPostgreSQL directory, including the data directory within %appdata%
  • Removed some PgAdmin-III registry entries that pointed to PostgreSQL
  • Removed the service account for postgres from services.msc

When I reboot and try the installer again it fails with the same message.

The install-postgresql.log file from %TEMP% contains:

Executing cscript //NoLogo "C:Program FilesPostgreSQL9.2/installer/server/initcluster.vbs" "NT AUTHORITYNetworkService" "postgres" "****" "C:Program FilesPostgreSQL9.2" "C:Program FilesPostgreSQL9.2data" 5432 "DEFAULT"
Script exit code: 1

then another error a bit later:

creating template1 database in C:/Program Files/PostgreSQL/9.2/data/base/1 ... initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error

See full installer log file download here.

Community's user avatar

asked Nov 17, 2012 at 1:08

Celeritas's user avatar

1

It appears that the root cause of this issue may have been that @Celeritas’s computer had an incorrect value for the COMSPEC environment variable. It had a trailing semicolon, so instead of the normal:

C:Windowssystem32cmd.exe

it was:

C:Windowssystem32cmd.exe;

This one-character difference is enough. The above isn’t a valid command prompt path, so popen() calls were failing. Unfortunately, instead of something useful like:

'"C:Windowssystem32cmd.exe;"' is not recognized as an internal or external command, operable program or batch file

it instead reports the delightfully useful error No error:

initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error

See related:

  • http://forums.enterprisedb.com/posts/list/2125.page
  • http://postgresql.1045698.n5.nabble.com/initdb-failure-td2083455.html

I’ve reported this to the installer team and written a wiki entry to describe it. See blog post.

The issue was eventually resolved by:

  • Editing the COMSPEC environment variable
  • Uninstalling PostgreSQL
  • Rebooting
  • Reinstalling PostgreSQL

though there was a lot more before that which shouldn’t actually be necessary to resolve this, including doing a total manual clean uninstall of PostgreSQL by hand.

Now I just want to find the people who wrote the program that modified this environment variable.

answered Nov 19, 2012 at 4:17

Craig Ringer's user avatar

Craig RingerCraig Ringer

54.2k3 gold badges150 silver badges185 bronze badges

1

from this answer https://dba.stackexchange.com/a/248584/185153

If you’re on Windows 10 with codepage UTF-8 in regional settings (picture in link above), the root cause is that :

  1. Cluster initialization in setup calls initdb
  2. initdb checks version as if calling postgres -V
  3. postgres -V doesn’t recognise CPutf8 yet then returns an unmatched result.

Until it is properly fixed, you may just uncheck UTF-8 codepage box and restart, it will be okey.

This can reproduced in PostgreSQL 12 also.

Kudos to @simon for this finding.

answered Oct 27, 2019 at 7:22

sandthorn's user avatar

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 FilesPostgreSQL10bin»

2) Once you are inside the «C:Program FilesPostgreSQL10bin» directory execute the following command.

.initdb.exe -D «C:Program FilesPostgreSQL10data»

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.

answered May 27, 2020 at 20:22

Samiksha Warang's user avatar

6

Problem:

Installing 13.1.1 on Windows Server 2019 failed with the message

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

  • My COMSPEC environment variable was configured correctly.

  • My UTF-8
    codepage setting was disabled.

  • Manually envoking initdb failed with the following:

     PS C:Program FilesPostgreSQL13bin> .initdb.exe -D "D:PostgreSQL"
     The files belonging to this database system will be owned by user "myUser".
     This user must also own the server process.
    
     The database cluster will be initialized with locale "English_United States.1252".
     The default database encoding has accordingly been set to "WIN1252".
     The default text search configuration will be set to "english".
    
     Data page checksums are disabled.
    
     fixing permissions on existing directory D:/PostgreSQL ... ok
     creating subdirectories ... ok
     selecting dynamic shared memory implementation ... windows
     selecting default max_connections ... 100
     selecting default shared_buffers ... 128MB
     selecting default time zone ... US/Eastern
     creating configuration files ... ok
     running bootstrap script ... 2021-01-25 09:55:49.793 EST [51184] LOG:  unrecognized win32 error code: 50
     2021-01-25 09:55:49.804 EST [51184] LOG:  could not link file "pg_wal/xlogtemp.51184" to "pg_wal/000000010000000000000001": Invalid argument
     2021-01-25 09:55:49.808 EST [51184] FATAL:  could not open file "pg_wal/000000010000000000000001": No such file or directory
     child process exited with exit code 1
     initdb: removing contents of data directory "D:/PostgreSQL"
    

Probable cause:

Drive D: is formatted using ReFS. Initializing on an NTFS drive worked without issue.

Solution:

Initialize the database on drive C:PostgreSQL and then copy folder to D:PostgreSQL.

Open terminal as normal user (not admin) and run:

C:UsersmyUser>"C:Program FilesPostgreSQL13binpg_ctl.exe" -D "D:PostgreSQL" -l logfile start
waiting for server to start.... done
server started

Launch a psql shell and login with user myUser. You can then create a postgres user if desired:

CREATE ROLE postgres LOGIN PASSWORD 'password' NOINHERIT CREATEDB;
CREATE SCHEMA postgres AUTHORIZATION postgres;
GRANT USAGE ON SCHEMA postgres TO PUBLIC;

answered Jan 25, 2021 at 15:38

Jonathan Jusczyk's user avatar

For people still struggleing with this in 2022. The only thing that worked for me on Windows 10 is selecting English America as the local rather then my own latin locale.

answered Jan 19, 2022 at 10:02

Slobodan Margetić's user avatar

При развертывании PostgreSQL 9.5 в Windows Server 2003 появляется предупреждающее сообщение: проблема с выполнением шага после установки. Установка может завершиться неправильно. Сбой инициализации кластера базы данных. Ошибка инициализации базы данных.

 

После окончания папка данных пуста. Многие ошибки установки в Интернете в основном вызваны тем, что параметр Locale не выбирает значение по умолчанию. Я не выбрал по умолчанию.

Позже я проверил разрешения для папки данных и обнаружил, что текущая учетная запись не имеет разрешений для этой папки. Измените разрешение, перезапустите программу установки, приглашение уже существует, продолжите работу, просто установите папку в каталоге данных, чтобы изменить разрешения только сейчас.

Причина может быть связана с учетной записью администратора. PostgreSQL не рекомендует использовать учетную запись администратора для использования PostgreSQL.

Не могу установить Postgresql. Все перепробовала:

  • Я запускаю установку как администратор.
  • Я создаю пользователя postgresql и добавляю его в группу администраторов.
  • Я устанавливаю его прямо на C: postgresql.

Но безуспешно. для информации: у меня windows 8

12 ответов

Лучший ответ

  • Прежде всего запустите настройку от имени администратора.
  • Выберите папку для установки внутри программных файлов (по умолчанию)
  • Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)


5

ISONecroMAn
21 Фев 2016 в 10:16

Другой способ решить эту проблему — изменить регион (язык) вашей операционной системы (Машины). Если вы выбираете, например, французский, возьмите французский из Франции, а не местный французский. То же самое для английского, а не местного английского. Некоторые символы не работают с местным языком. Думаю, это решит вашу проблему.


0

Y4glory
14 Июл 2020 в 21:13

Для меня это терпело неудачу каждый раз и для каждого решения, упомянутого здесь. Затем, после небольших собственных исследований и разработок, я смог успешно использовать postgresql. Ниже приведены шаги, которые необходимо выполнить при обнаружении этой ошибки «сбой при инициализации кластера базы данных».

Вы должны вручную запустить initdb, который присутствует: «C: Software PostgreSql 12 bin»

Теперь убедитесь, что вы связали «postgres» как пользователя с командой initdb, поскольку «postgres» — это суперпользователь, созданный во время установки.

initdb -D «D: PostgreSql 12 data» -U postgres

Теперь, когда кластер базы данных инициализирован, вы можете запустить сервер с помощью утилиты pg_ctl, находящейся в папке bin PostgreSql 12.

pg_ctl start -D «D: PostgreSql 12 data»

Или вы также можете зарегистрировать его как службу Windows, и вы можете установить его на автоматический

pg_ctl register -N PostgreSql-12.3.1 -D «D: PostgreSql 12 data»

Теперь вы готовы к использованию базы данных postgresql. Либо используйте его через строку cmd (psql), либо pgAdmin4


0

Abhilaksh Sharma
6 Июл 2020 в 20:25

Я пытался и терпел неудачу несколько раз, думая, что это как-то связано с правами и пользователем, которые использовались во время установки. Но благодаря совету ThangLeQuoc по проверке журнала установки я нашел причину:

initdb: недопустимое имя локали «NorwegianBokm † l, Norway»

Вызывается Die (не удалось инициализировать кластер базы данных с помощью initdb) …

Не удалось инициализировать кластер базы данных с помощью initdb

Итак, после выбора «локали по умолчанию» в процессе установки все прошло нормально. Это было в версии 11.6 OS Postgres.


0

Community
20 Июн 2020 в 09:12

Я выполнил шаги, предложенные @IsoNecroMad, и это сработало

1) Прежде всего, запустите настройку от имени администратора.

2) Выберите папку для установки внутри программных файлов (по умолчанию)

3) Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)


0

umang-malhotra
19 Авг 2019 в 12:39

Возможное решение для 10.3. версия:

  1. Загрузить установочный файл PostgreSQL

  2. Переместите загруженный файл на диск C: .
    Пример: C:postgresql-10.3-2-windows-x64.exe

  3. Создайте каталог с именем PostgreSQL на диске C:

  4. Создайте каталог с именем 10 в ранее созданном каталоге PostgreSQL.
    Итак, вам нужно иметь C: PostgreSQL 10 .

  5. Запустите C: postgresql-10.3-2-windows-x64.exe (НЕ НАЖИМАЙТЕ «ЗАПУСТИТЬ ОТ АДМИНИСТРАТОРА», просто дважды щелкните)

  6. Измените путь к каталогу установки на C:PostgreSQL

  7. Измените путь к каталогу данных на C:PostgreSQLdata

  8. финиш

Надеюсь, установка пройдет успешно.


0

Spectarion
11 Апр 2018 в 20:19

Задача решена:

Запустите установку от имени администратора и используйте режим Windows 7


0

xAminex
10 Сен 2015 в 12:22

Я столкнулся с той же проблемой при попытке установить postgres 10.3. Запуск от имени администратора мне не помог. Но он был установлен правильно, когда я изменил каталог установки с каталога по умолчанию, который находится внутри Program Files. Вместо этого я создал новую папку на диске C и сделал ее каталогом установки.


1

Shamil Puthukkot
4 Мар 2019 в 05:09

Я устанавливал Postgres версии 9.5 (в Windows 7 и с помощью установщика DBEnterprise) … для меня проблема, похоже, в том, что я выбирал «POSIX» в качестве региональной конфигурации … Но я пробовал с региональной конфигурацией «C» Настройка и установка завершились без проблем …

Также я запускаю установщик от имени администратора!


1

Carlitos Way
16 Май 2016 в 22:54

Только не используйте установщик EDB. Сейчас есть альтернатива BigSQL.


2

Basil
21 Авг 2016 в 17:53

Сейчас 2019 , и у меня все еще та же проблема с Postgres 11 . Перед этим я удаляю текущий Postgres 9.6 (если я правильно помню версию) и пытаюсь установить новый Postgres 11, и возникает проблема. Я пробовал следующие подходы, но ни один из них не работает:

  • Запускать установку от имени администратора при каждом запуске -> сбой
  • Выберите папку для установки по умолчанию, предложенную при установке (C: / Program Files / PostgresSQL / 11), и папку данных, расположенную в другом
    место -> не удалось
  • Установить его за пределами C: / -> все равно не удалось

Единственный подход, который я, к счастью, нашел, почесав голову почти весь день, — это сообщение
Я хотел бы быстро резюмировать решение, если срок действия ссылки истек.

Решение :
— Удалите PostgreSQL
— CMD: net user postgres / delete
— Панель управления -> Учетные записи пользователей -> Настроить дополнительные свойства профиля пользователя -> удалить все экземпляры «Неизвестного пользователя», которые кажутся оставшимися от postgres
— Выполнить> compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> Новый пользователь … -> Имя пользователя: postgres, Пароль: postgres -> Создать
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Добавить … -> Администраторы -> ОК
— скопируйте postgresql-8.4.9-1-windows.exe в C:
— runas / user: postgres cmd.exe -> cd -> postgresql-8.4.9-1-windows.exe -> успешно установлен без ошибок. Папка с проверенными данными и подтвержденные файлы созданы успешно. (это означает, что вы должны запустить установку с созданным пользователем postgres )
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Администраторы -> Удалить
— compmgmt.msc -> Локальные пользователи и группы -> Пользователи -> postgres -> Член -> Добавить … -> Опытные пользователи -> ОК
— Установлен HM2 -> БД успешно создана
— Перезагрузка компьютера -> HM2 работает правильно (т.е. просто для проверки автоматического запуска службы postgresql)

Советы профессионалов: Чтобы получить представление о журнале установки, перейдите на % TEMP%, выполнив поиск по запросу «% TEMP%» на панели задач, имя журнала будет bitrock_installer-xxx.log. Вы хотели бы знать, что происходит, чтобы быстрее устранить проблему.


6

ThangLeQuoc
13 Янв 2019 в 17:14

Я попытался установить postgresql 8.4 В моем windows 7 (64 бит). Но это не удается со следующими сообщениями в log

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

Script output:
 CScript Error: Can't find script engine "VBScript" for script "C:PostgreSQL.4installerserverinitcluster.vbs".

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:PostgreSQL.4/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:PostgreSQL.4" "C:PostgreSQLdata" 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%

я погуглил об этом и запустил команду regsvr32 vbscript.dll «и показывает сообщение» DllRegisterServer в vbscript.dll удалось», но он не решил мою проблему.

также я установил значение по умолчанию для {B54F3741-5B07-11cf-A4B0-00AA004A55E8} в реестре в путь к файлу vbscript.dll, но он также не решил мой вопрос.

Как исправить эту проблему?

16 ответов


следующая ссылка решить мою проблему

PostgreSQL Database Cluster Initialisation Failed Solution

текст статьи:

Я буду держать это коротким и сладким. Для тех из вас, кто пытался
чтобы установить PostgreSQL (мой был 8.3.7-1) в Windows Vista и получил
ошибка инициализации кластера базы данных ошибка в конце
установите, прочитайте это.

в проблема в том, что Vista имеет некоторые особенности, связанные с
настройка разрешений для папки Program Files. В принципе, даже если
вы администратор, вы не можете изменить разрешения на некоторые папки, такие как
Саму папку Program Files и Windows. Это заставляет initdb быть
не удалось создать некоторые папки и кластер базы данных. Что это
означает для вас нужно установить PostgreSQL в другую папку
это не внутри программных файлов.

кстати, если у вас есть забыли пароль учетной записи Postgres
установка в первый раз, просто откройте Командную строку в Vista (если вы
не знаю, как, Google для этого). Затем введите команду «net user». Вы
появится список пользователей на вашем компьютере. Найдите аккаунт Postgre.
Обычно это «Постгрес». Тогда вам нужно изменить свой пароль
введите «net user postgres new_password», где new_password … ну,
новый пароль для учетной записи. Вам понадобится этот postgres
внимание во время установки. Вы для этого потребуются права администратора
однако перемены.

во-первых, удалите все неудачные установки. Использовать панель управления или
установщик PostgreSQL в папке установки.

во время установки, вам будет предложено выбрать, где вы хотите
установить программу. Просто выберите место в другом месте. Как
«C:PostgreSQL-или что-то в этом роде. Это может быть даже на вашем рабочем столе.
Но не внутри программных файлов. Не внутри папки Windows. Однако, это
не так просто. Потерпеть меня.

после установки вы все равно увидите это проклятое сообщение об ошибке (или
произошло что-то вроде неустранимой ошибки). Не отчаивайтесь! (для Windows
Опытные пользователи, мы просто назначаем разрешение на полный контроль Postgres
учетная запись в новой папке установки PostgreSQL). Для других пользователей, читать
если вы не знаете, как это сделать.

перейдите туда, где вы только что установили PostgreSQL. В этом случае C:
водить. Нет, щелкните правой кнопкой мыши на папка (обычно называется PostgreSQL),
и перейдите на вкладку Свойства – безопасность. Нажмите на кнопку Изменить. Вы
теперь увидите некоторые имена пользователей и другие вещи. Нажмите на кнопку Добавить.
В поле» введите имена объектов для выбора «введите» postgres » и
нажмите Проверить. Там должна появиться учетная запись пользователя Postgres. Нажмите кнопку Ok.

теперь в поле «группа или имена пользователей» выберите учетную запись Postgres. В
окно ниже, с большим количеством флажков, назначить разрешение » полный
Контроль» в Позвольте колонке к нему. Обратите внимание, если вы не хотите разрешать
полный контроль, просто дайте ему читать / писать. Но я просто пошел вперед и отдал
это полный контроль. (Я устал и был раздражен. Большинство «современных
базы данных с открытым исходным кодом» не удалось установить!). Нажмите на Ok и подождите
бит для разрешений для применения.

затем просто выполните повторную установку. Не удаляйте ничего. Просто запустите
программу установки еще раз. Он скажет, что папка установки PostgreSQL уже существует
и другие вещи. Просто нажмите далее до завершения установки. Если вы
см. ошибки «файл не может быть скопирован», нажмите кнопку «игнорировать», когда
необходимый.


я получил тот же результат установки «postgresql-9.2.3-1-windows-x64.exe » в Windows 7 Enterprise
и проблема будет решена, когда я изменить путь установки.

попробуйте установить в «c:postgresql» вместо «c:program filesPostgresql«

удачи


Я вытащил ссылку шина из кэша google:

оригинальная ссылка:
http://www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/

кэшированную ссылку:
http://webcache.googleusercontent.com/search?q=cache:RXu-5-ZzfcgJ:www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/+&cd=3&hl=ro&ct=clnk


Кластер Баз Данных PostgreSQL Ошибка Инициализации Решения

Я буду держать это коротким и сладким. Для тех из вас, кто пытался установить PostgreSQL (мой был 8.3.7-1) в Windows Vista и получил ошибку инициализации кластера базы данных ошибок в конце установки, прочитайте это.

проблема в том, что Vista имеет некоторые функции безопасности, связанные с настройкой разрешений на папку Program Files. В принципе, даже если вы администратор, вы не можете изменить разрешения на некоторые папки, такие как Саму папку Program Files и Windows. В результате initdb не удается создать некоторые папки и кластер базы данных. Это означает, что вам нужно установить PostgreSQL в другую папку, которая не находится внутри программных файлов.

кстати, если вы забыли пароль учетной записи Postgres при установке в первый раз, просто откройте Командную строку в Vista (если вы не знаете, как, Google для него). Затем введите команду «net user». Вы увидите список пользователей компьютер. Найдите аккаунт Postgre. Обычно это «Постгрес». Затем вам нужно изменить свой пароль, введя «net user postgres new_password», где new_password… ну, новый пароль для учетной записи. Вам понадобится эта учетная запись postgres во время установки. Однако для этого вам понадобятся права администратора.

во-первых, удалите все неудачные установки. Используйте Панель управления или установщик PostgreSQL в папке установки.

во время установки, вы будет предложено выбрать, где вы хотите установить программу. Просто выберите место в другом месте. Как …C:PostgreSQL-или что-то в этом роде. Это может быть даже на вашем рабочем столе. Но не внутри программных файлов. Не внутри папки Windows. Однако, это не так просто. Потерпеть меня.

после установки вы все равно увидите это проклятое сообщение об ошибке (или что-то вроде неустранимой ошибки). Не отчаивайтесь! (Для пользователей Windows Power мы просто назначаем разрешение на полный контроль Учетная запись Postgres в новой папке установки PostgreSQL). Для других пользователей, читайте дальше, если вы не знаете, как это сделать.

перейдите туда, где вы только что установили PostgreSQL. В этом случае диск C:. Там щелкните правой кнопкой мыши папку (обычно называемую PostgreSQL) и перейдите на вкладку Свойства – безопасность. Нажмите на кнопку Изменить. Теперь вы увидите некоторые имена пользователей и другие вещи. Нажмите на кнопку Добавить. В поле » введите имена объектов для выбора «введите» postgres » и нажмите кнопку Проверить. Пользователь Postgres’ аккаунт должен появиться там. Нажмите кнопку Ok.

теперь в поле «группа или имена пользователей» выберите учетную запись Postgres. В окне ниже, с большим количеством флажков, назначьте ему разрешение «полный контроль» в столбце разрешить. Обратите внимание, если вы не хотите разрешать полный контроль, просто дайте ему чтение/запись. Но я просто пошел вперед и дал ему полный контроль. (Я устал и был раздражен. Не удалось установить «самую передовую базу данных с открытым исходным кодом в мире»!). Нажмите на Ok и немного подождите разрешения на быть применены.

затем просто выполните повторную установку. Не удаляйте ничего. Просто запустите настройку еще раз. Он скажет, что папка установки PostgreSQL уже существует и другие вещи. Просто нажмите кнопку Далее, пока не закончится установка. Если вы видите ошибки «файл не может быть скопирован», нажмите кнопку» игнорировать», когда это необходимо.


для меня проблема заключалась в том, что переменная PATH не имела C:Windowssystem32 и поэтому он не нашел команду ICACLS для изменения разрешений папки. Поэтому решение состоит в том, чтобы добавить C:Windowssystem32 системной переменной PATH (если она еще не содержит ее):

  1. Панель Управления — > Система — > Дополнительные Настройки Системы — > Дополнительно — > Переменные Среды
  2. В разделе » системная переменная «найдите и выберите»путь»
  3. Нажмите «Редактировать…»
  4. Теперь, если значение не содержит путь к строке добавления system32 «;C:Windowssystem32 » (или где ваш путь windows)

4

автор: Justinas Saldukas



У меня была такая же проблема при попытке установить PostgreSQL 9.3.5-3 на машине Windows 7 x64 (не присоединенной к домену) в папке, созданной в корне, с полным доступом ко всем. Проблема была решена, не используя ä в моем пароле, поэтому избегайте использования неанглийских символов в пароле.


это сообщение все еще происходит в Postgres v9.3.1.1.

для меня проблема заключалась в запуске установщика под на учетная запись «Администратор». Это не работает. Запустите его под an учетная запись администратора, избегая встроенной учетной записи «Администратор».

Я действительно не знаю, как это обычно называется, но это тот, который уже существует на новой установке; тот, который не может быть изменен на стандартного пользователя; тот, чей профиль хранится в C:UsersAdministrator. Оказывается, это была плохая идея использовать эту учетную запись; узнал это на горьком опыте.

(64-разрядная версия Windows Server 2008 R2)


устранение:

• Удаление PostgreSQL

* команда запуска: net user postgres / delete

• нажмите: Панель управления — > Учетные записи пользователей — > настроить дополнительные свойства профиля пользователя — > удалить все экземпляры «неизвестный пользователь», которые, похоже, остались от установки PostgreSQL.

• Run: compmgmt.msc — > нажмите Локальные пользователи и группы — > пользователи — > новый пользователь… — > имя пользователя: postgres, пароль: postgrespass — > создать

• Run: команду compmgmt.msc — > нажмите Локальные пользователи и группы — > пользователи — > postgres — >член — > добавить… — > администраторы — > OK

• скопируйте установщик PostgreSQL postgresql-8.4.9-1-окна.exe для C:

• Run:runas /user: postgres cmd.exe — > cd — > postgresql-8.4.9-1-окна.exe — > успешно установлен без ошибок. Проверена папка данных и подтвержденные файлы, созданные успешно.

• Run: compmgmt.msc — > Локальные пользователи и группы — > пользователи — > postgres — > член — >Администраторы — > Удалить

• Run: compmgmt.msc — > Локальные пользователи и группы — > пользователи — > postgres — > член — > добавить… — > опытные пользователи — > OK


Эй, ребята, ответ очень прост, просто установите postgresql в другую папку вне программных файлов. он запрашивает неустранимую ошибку и переходит к установке…


Я решил ту же проблему в Windows Server 2003 и postgres 9.2.9-3, предварительно создав каталог для установки и предоставив полный доступ к нему группе «пользователи».


ответ очень прост, переместите скачанный .exe-файл в другую папку . например: c:postgres и попробуйте установить его.

ваша проблема связана с некоторыми проблемами привилегий администратора


кажется, что есть много причин, вызывающих сбой установки.

в моем случае я использую Windows 10 home edition, которая не имеет предварительного контроля группы пользователей,
поэтому многие решения выше не работают для меня. И я предполагаю, что именно поэтому установка терпит неудачу.

Я просто использую установщик BigSQL вместо установщика EnterpriceDB,

выберите второй установщик в центр загрузки posgresql

или посетите параметру bigsql напрямую.


Я знаю, что это не решение, но установка 32 бит Postgres, работал для меня

0

автор: robert jebakumar2


У меня была та же проблема при попытке установить PostgreSQL 9.6.2 на 32-битной машине Windows 7, но я получил решение, сначала просто удалите установленные postgres, затем удалите папку postgres с диска «c», удалите запись из temp-файла, который находится в «C:UsersAppDataLocalTemp».Затем снова установлен postgres 9.6.2, который успешно установлен.


была такая же проблема, пытаясь установить на моем компьютере компании (ПК под управлением Windows 7). Если вы не являетесь администратором на вашем компьютере, вам необходимо установить его в вашей личной папке «пользователь» (не в папке «Program Files» в корне).

Если вы все еще не можете получить доступ к Postgres:

Как только вы установили его в папку «пользователь», используйте программу » Run «и введите» services.msc » и нажмите enter. В окне, которое выскакивает, спустись к себе. установка postgres, щелкните правой кнопкой мыши и перейдите в раздел «Свойства». На вкладке «вход» выберите «Учетная запись локальной системы», затем вернитесь на вкладку» Общие «и нажмите»Пуск». После этого он должен загрузиться.

после этого я смог запустить «pgAdmin» и получить доступ к базе данных (после ввода пароля, который я использовал во время установки).


у меня была та же проблема сегодня при установке postgres 9.6.19 в windows 10.
Решение: ни путь установки, ни переменная пути windows не может содержать пробел! Ближе к концу файла журнала установки (найдено в wondows %temp% dir с именем bitrock_installer_16156.журнала) я нашел:

скрипт stderr: «UnxUtilsusrlocalwbin»;»C:Program Канн
syntaktisch с Дизер Стелле нихт verarbeitet Верден.

установка каталог я, как мои окна переменную %PATH содержала

C:Program Files

решение:
откройте командную строку от имени администратора и введите:

set path=C:WINDOWSsystem32
PostgreSQL-9.6.10-1-win64-bigsql.exe

и затем, конечно, выберите путь, не содержащий пустого.
Это помогло мне.


This page is intended to help people collect information to troubleshoot problems with the PostgreSQL Installers supplied by EnterpriseDB.

Many problems have already been identified and fixed, so make sure you’re using the installer for the latest point-release of PostgreSQL before reporting a problem.

Because some problems can’t be fixed in the installer, but are issues with the Windows installation or how it is being used, there is also a list of frequently asked questions and frequently encountered problems with PostgreSQL on Windows. Please read the common installation errors section, or preferably the whole document. You’ll probably save some time and hassle by doing so.

If you’ve tried all that, and you’re still having problems getting PostgreSQL installed, please read on to find out how you can collect the information we need to be able to help you with installation problems.

Contents

  • 1 Make sure you’re installing on a supported platform
  • 2 Try again without your virus scanner or 3rd-party firewall
  • 3 Read about other common installation problems
  • 4 Reporting an installation error
    • 4.1 Note down the basic information about your system
    • 4.2 Collect the installer log file
    • 4.3 Get the contents of the PostgreSQL server error log
    • 4.4 Extra information Windows users need to collect
      • 4.4.1 Windows: Check for messages in the Windows event log
      • 4.4.2 Windows: Check what Group Policy, if any, is active on your computer
      • 4.4.3 Windows: Take a copy of the environment variables set on the computer

Make sure you’re installing on a supported platform

See the installer download page and (for Windows) the Running & Installing PostgreSQL On Native Windows for platform support details.

Please do not ask the mailing list for help with installation on unsupported Windows platforms. However, one of the paid PostgreSQL consultants, or EnterpriseDB (who make the PostgreSQL installer) may be able to help you on a paid basis.

Try again without your virus scanner or 3rd-party firewall

The Windows FAQ discusses potential issues with antivirus software and 3rd-party firewalls. If you’re encountering any installation issues, please try again with your virus scanner uninstalled (not just disabled) to see if the problem goes away. If it does, please report the fact to the mailing list and to the vendor of your antivirus product.

Read about other common installation problems

Before reporting a problem, please read the windows FAQ to see if your problem is one we’ve already seen and found a workaround or fix for.

Reporting an installation error

To be able to help you with an installation problem, we will need you to collect some basic details about your computer and the problem. Please see the instructions below.

Note down the basic information about your system

Any problem report must include:

  • The exact words of any error message you see when the installation fails
  • The exact version of PostgreSQL you are installing
  • Whether you installed a 32-bit or 64-bit release of PostgreSQL
  • The operating system and version you are using, eg:
    • «Windows XP Professional with Service Pack 3»
    • «Mac OS X 10.4.2»
    • «Fedora Core 14»
  • Whether you are running a 32-bit or 64-bit version of your operating system
  • How you ran the installer. Command-line arguments, what user account you ran it from, etc.
  • What antivirus and/or software firewall products you have installed, if any, even if they are disabled
  • Which, if any, of the troubleshooting instructions you have already tried
  • Whether a previous version of PostgreSQL was installed, and if so:
    • whether you uninstalled it before running the new installer
    • If you uninstalled a previous version, whether you did it with the uninstaller or some other way
    • Whether you removed the postgres user/service account when you uninstalled
  • Additional details and platform-specific information as described below

Collect the installer log file

The installer creates a log file in the system ‘temp’ directory. This will log all manner of data about the installation, and is invaluable when troubleshooting. The log will be called install-postgresql.log if the installation completed successfully. If not, the installer may not have been able to rename it, in which case the name will be either bitrock_installer.log or bitrock_installer_xxx.log, where xxx is a number (actually the process ID of the installation attempt).

On Linux and Mac systems, the logfile will almost always be found in the /tmp/ directory.

On Windows, the easiest way to find the logfile is to click Start -> Run, enter %TEMP% in the box and then click OK (these instructions apply to Windows XP and 2003 — adjust as necessary for other versions).

Get the contents of the PostgreSQL server error log

The PostgreSQL server has its own error log. This may not exist if installation failed early on, but it can be very informative for errors that happened later in installation. You can find it in the «pg_log» folder inside the data directory you chose for PostgreSQL. If it exists, please include it in any problem reports.

Windows users must collect additional Windows-specific details to help troubleshoot installation issues:

  • (On Windows Vista and Windows 7): The UAC security level
  • Whether you started the installer by logging in as Administrator, started it from from your own normal user account, or ran it using the «Run As Administrator» menu option.
  • Whether your computer is a part of a Windows domain. Home computers usually are not, business computers usually are.
  • Whether your computer and network has any Group Policy configured. If you’re on a corporate windows domain you probably have group policy and need to ask your network administrator for details about it.

Windows: Check for messages in the Windows event log

Please check the Windows Event Viewer for messages that might be related to installation problems or service startup problems.

TODO: detail on how to collect and save events.

Windows: Check what Group Policy, if any, is active on your computer

TODO: instructions for collecting domain and local group policy.

Windows: Take a copy of the environment variables set on the computer

Open a command prompt and run «set». Then copy and paste the results into your problem report.

I’d be better to collect the «all users» environment from the system control panel, but it’s not easy to just dump this information.

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

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

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

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

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

При инициализации БД выдает след. ошибку

postgres@1csrv:/usr/LOCAL/pgsql/bin$ ./initdb -D /DATA
The files belonging TO this DATABASE system will be owned BY user "postgres".
This user must also own the server process.
 
The DATABASE cluster will be initialized WITH locale C.
The DEFAULT DATABASE encoding has accordingly been SET TO SQL_ASCII.
The DEFAULT text search configuration will be SET TO "english".
 
fixing permissions ON existing directory /DATA ... ok
creating subdirectories ... ok
selecting DEFAULT max_connections ... 100
selecting DEFAULT shared_buffers ... 32MB
creating configuration files ... ok
creating template1 DATABASE IN /DATA/base/1 ... ok
initializing pg_authid ... FATAL:  syntax error at OR near "REVOKE" at character 1
STATEMENT:  REVOKE ALL ON pg_authid FROM public;
 
child process exited WITH exit code 1
initdb: removing contents of DATA directory "/DATA"
postgres@1csrv:/usr/LOCAL/pgsql/bin$ 

ОС Slackware 13.37, Postgresql 9.0.3.
Исходники и патчи брал с сайта 1С. Скомпилировалась и установилаь без ошибок.
Подскажите где посмотреть?

Понравилась статья? Поделить с друзьями:
  • При инициализации системы secret net произошли ошибки
  • При инициализации базы данных возникла непредвиденная ошибка hoi4
  • При запуске программ выдает ошибку 0xc0000005
  • При измерении детали получаются случайные ошибки
  • При запуске приложения выдает ошибку 0xc0000142