![](/img/trans.png)
[英]pg_upgrade on Windows cannot write to log file pg_upgrade_internal.log
[英]Error using pg_upgrade going from PostgreSQL 10 to 12
我安裝了 PostgreSQL 10,並且剛剛安裝了 PostgreSQL 12(在 Windows 上)。 我正在嘗試使用pg_upgrade
遷移數據庫。 但是,我收到了一個煩人的錯誤:
我運行的命令如下:
$ pg_upgrade.exe -b 'C:\Program Files\PostgreSQL\10\bin\' -B 'C:\Program Files\PostgreSQL\12\bin\
' -d 'C:\Program Files\PostgreSQL\10\data\' -D 'C:\Program Files\PostgreSQL\12\data\'
但是,我收到錯誤消息:
You must identify the directory where the new cluster binaries reside.
Please use the -B command-line option or the PGBINNEW environment variable.
Failure, exiting
...盡管顯然這樣做了。
有人見過這個嗎?
在此頁面的步驟“9)運行 pg_upgrade”中的“對於 Windows 用戶 ..”用戶部分:
對於 Windows 用戶,您必須登錄管理帳戶,然后以 postgres 用戶身份啟動 shell 並設置正確的路徑:
RUNAS /USER:postgres "CMD.EXE" SET PATH=%PATH%;C:\\Program Files\\PostgreSQL\\12\\bin;
然后使用引用的目錄運行 pg_upgrade,例如:
pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/9.6/data" --new-datadir "C:/Program Files/PostgreSQL/12/data" --old-bindir "C:/Program Files/PostgreSQL/9.6/bin" --new-bindir "C:/Program Files/PostgreSQL/12/bin"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.