![](/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.