我按照这些说明将 Postgres 数据目录从 C:\Users\username\Documents\dir\postgres96_data 移动到 C:\Users\username\Documents\postgres96_data。
现在 Postgres 服务将无法启动。尝试手动启动它会产生以下消息(免费翻译自 pt-br):
“本地计算机上的 postgres-x64-9.6 服务启动然后停止。如果某些服务没有被其他服务或程序使用,它们会自动停止。”
我尝试(成功)使用命令在 cmd.exe 中启动数据库
"C:\Program Files\PostgreSQL\9.6\bin\pg_ctl.exe" start -D "C:\Users\username\Documents\postgres96_data" -w
日志是:
2017-02-20 07:33:26 BRT LOG: database system was interrupted; last known up at 2017-02-18 09:52:00 BRT
2017-02-20 07:33:27 BRT FATAL: the database system is starting up
...
2017-02-20 07:35:10 BRT FATAL: the database system is starting up
2017-02-20 07:36:19 BRT LOG: database system was not properly shut down; automatic recovery in progress
2017-02-20 07:36:19 BRT LOG: invalid record length at 6/438EBB88: wanted 24, got 0
2017-02-20 07:36:19 BRT LOG: redo is not required
2017-02-20 07:36:19 BRT LOG: MultiXact member wraparound protections are now enabled
2017-02-20 07:36:19 BRT LOG: sistema de banco de dados está pronto para aceitar conexões [database system is ready to accept conections, free translation]
2017-02-20 07:36:21 BRT LOG: autovacuum launcher started
先前的研究