postgres for windows 安装时出现 postinstall 错误

postgres for windows 安装时出现 postinstall 错误

我的电脑运行的是 Windows 10 版本 1803。

我下载了包含 postgres 10 二进制文件的 zip。

当我尝试使用以下命令初始化数据库时:

initdb.exe -D ../data –A trust

我收到此错误:子进程因异常 0xC00000FD 而终止

creating directory ../data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... windows
creating configuration files ... ok
running bootstrap script ... child process was terminated by exception 0xC00000FD
initdb: removing data directory "../data"

我尝试更改版本但 postgres 11 和 postgres 9.6 给出了相同的结果。

因此我尝试从 Windows 安装程序安装 postgres 10,但 %TEMP% 文件夹中的日志记录了相同的错误:

    Executing batch file 'rad99CE0.bat'...
    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 "English_United States.1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory C:/Program Files/PostgreSQL/10/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... windows
creating configuration files ... ok
running bootstrap script ... child process was terminated by exception 0xC00000FD
initdb: removing contents of data directory "C:/Program Files/PostgreSQL/10/data"

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\10/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Program Files\PostgreSQL\10" "C:\Program Files\PostgreSQL\10\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.
[16:02:52] Delete the temporary scripts directory...
Creating menu shortcuts...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\10\installer\server\createshortcuts_clt.vbs" "PostgreSQL 10" "C:\Program Files\PostgreSQL\10"
Script exit code: 0

我尝试卸载并使用 postgres 用户重新安装,并为 postgres 用户提供管理员组,但没有任何变化。

由于安装在外部硬盘上,我尝试在另一台装有 Windows 10 的 PC 上对同一个 postgres10/bin 文件夹执行相同的初始化,并且数据库首次初始化成功。无需安装。数据库启动正常:

pg_ctl.exe -D ../data start

当我将驱动器与原始 PC 上创建的数据文件夹重新连接时,如果我使用上述指令启动数据库,服务器将永远不会启动,并且在达到超时后,该过程将退出。根本没有日志。

D:\pgsql10\bin>pg_ctl.exe -D ../data start
waiting for server to start............................................................... stopped waiting
pg_ctl: server did not start in time

有任何想法吗?

答案1

看来我解决了sfc /scannow从安全启动的问题。我可以成功初始化数据文件夹并启动该过程。

相关内容