-2

我安装了 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

...尽管显然这样做了。

有人见过这个吗?

4

1 回答 1

1

此页面的步骤“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"
于 2020-08-26T23:32:06.467 回答