简体   繁体   中英

Error using pg_upgrade going from PostgreSQL 10 to 12

I have an installation of PostgreSQL 10, and just installed PostgreSQL 12 (on Windows). I'm trying to migrate over the databases using pg_upgrade . However, I'm getting an annoying error:

The command I ran was as follows:

$ 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\'

However, I get the error message:

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

... despite clearly doing so.

Anyone seen this before?

From the "For Windows users .." users section in step "9) Run pg_upgrade" at 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\\12\\bin;

and then run pg_upgrade with quoted directories, eg:

 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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM