Postgresql致命的数据库系统正在启动 - Windows 10

问题描述 投票:1回答:1

我在postgresql上的windows 10上安装了usb disk。每天当我从sleep开始我的电脑工作并再次插入磁盘然后尝试启动postgresql我收到此错误:

FATAL: the database system is starting up

该服务以以下命令启动:

E:\PostgresSql\pg96\pgservice.exe "//RS//PostgreSQL 9.6 Server"

这是默认的。

来自E:\PostgresSql\data\logs\pg96的原木

2019-02-28 10:30:36 CET [21788]: [1-1] user=postgres,db=postgres,app=[unknown],client=::1 FATAL:  the database system is starting up
2019-02-28 10:31:08 CET [9796]: [1-1] user=postgres,db=postgres,app=[unknown],client=::1 FATAL:  the database system is starting up

我希望这种启动更快发生。

postgresql
1个回答
2
投票

当您将数据提交到Postgres数据库时,唯一立即保存到磁盘的是write-ahead log。实际的表更改仅应用于内存缓冲区,并且在下一个checkpoint之前不会永久保存到磁盘。

如果服务器突然停止,或者它突然失去对文件系统的访问权限,那么内存中的所有内容都将丢失,下次启动时,需要重新启动日志才能将表恢复到正确的状态(可能需要一段时间,具体取决于自上次检查点以来发生了多少)。直到它完成,任何使用服务器的尝试都将导致FATAL: the database system is starting up

如果确保在拔出磁盘之前干净地关闭服务器 - 让它有机会设置检查点并刷新所有缓冲区 - 那么它应该能够或多或少地立即启动。

© www.soinside.com 2019 - 2024. All rights reserved.