使用 pg_upgrade 从 PostgreSQL 10 到 12 时出错

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\bin\' -B 'C:\Program Files\PostgreSQL\bin\
' -d 'C:\Program Files\PostgreSQL\data\' -D 'C:\Program Files\PostgreSQL\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 用户 ..”用户部分,位于 this page:

For Windows users, you must be logged into an administrative account, and then start a shell as the postgres user and set the proper path:

RUNAS /USER:postgres "CMD.EXE"
SET PATH=%PATH%;C:\Program Files\PostgreSQL\bin;

and then run pg_upgrade with quoted directories, e.g.:

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"