![](/img/trans.png)
[英]Postgres service won't start in Windows after pgdata directory was moved
[英]Postgres 13 service will not start after installing Postgres 14
我已經在我的 Windows 10 計算機上的本地服務器上成功使用 Postgresql 13 一年多了。 我昨天決定升級到14。
我在不同的端口上安裝了 14。 我去了 go 並按照以下命令升級: pg_upgrade -d "c:\Program Files\PostgreSQL\13\data" -D "c:\Program Files\PostgreSQL\14\data" -b "c:\Program Files\PostgreSQL\13\bin" -B "c:\Program Files\PostgreSQL\14\bin" -U Postgres
,但它說它無法連接到 13 服務器。 我重新啟動了計算機,13 的服務仍然無法啟動。
當我在 cmd 行鍵入pg_ctl -D "C:\Program Files\PostgreSQL\13\data" start
時,下面是我的日志中顯示的內容:
2022-02-15 08:53:45.908 +04 [92100] LOG: starting PostgreSQL 13.3, compiled by Visual C++ build 1914, 64-bit
2022-02-15 08:53:45.909 +04 [92100] LOG: listening on IPv6 address "::", port 5432
2022-02-15 08:53:45.910 +04 [92100] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-02-15 08:53:45.954 +04 [92672] LOG: database system was shut down at 2022-02-14 14:08:25 +04
2022-02-15 08:53:45.955 +04 [92672] LOG: invalid record length at 24/80B400C8: wanted 24, got 0
2022-02-15 08:53:45.955 +04 [92672] LOG: invalid primary checkpoint record
2022-02-15 08:53:45.955 +04 [92672] PANIC: could not locate a valid checkpoint record
2022-02-15 08:53:46.057 +04 [92100] LOG: startup process (PID 92672) was terminated by exception 0xC0000409
2022-02-15 08:53:46.057 +04 [92100] HINT: See C include file "ntstatus.h" for a description of the hexadecimal value.
2022-02-15 08:53:46.057 +04 [92100] LOG: aborting startup due to startup process failure
2022-02-15 08:53:46.059 +04 [92100] LOG: database system is shut down
我應該怎么做才能解決這個問題?
我已經做的是:
listen_addresses = '*'
未被注釋#host all all 0.0.0.0/0 scram-sha-256
哦,以防萬一,我對 Postgres 了解不多。 我可以根據需要使用它,僅此而已。
正如 JJanes 建議的那樣。 我做了一個備份,然后在 Postgres 14 的新服務器上恢復。它解決了問題。 謝謝你,傑內斯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.