I run a command that seems like it should work. Both the old bin and new bin dirs contain correct postgres versions. But the command fails as if this is reversed. What? Am? I? doing wrong?
pg_upgrade --old-bindir /usr/local/Cellar/postgresql/14.9/bin/ \
--new-bindir /usr/local/Cellar/postgresql@15/15.4/bin/ \
--old-datadir /usr/local/var/postgres.14.9.backup \
--new-datadir /usr/local/var/postgres \
check for "/usr/local/Cellar/postgresql@15/15.4/bin/postgres" failed: incorrect version: found "postgres (PostgreSQL) 15.4 (Homebrew)", expected "postgres (PostgreSQL) 14.9 (Homebrew)" Failure, exiting
I tried the new pg_upgrade binary and that resulted in
-----------------------------
Checking cluster versions
This utility can only upgrade to PostgreSQL version 15.
Failure, exiting
The pg_upgrade binary you call (which is found from your PATH in your example) needs to be the one from the new version, not from the old version.
Either fix your PATH, or give the absolute path to the pg_upgrade executable:
/usr/local/Cellar/postgresql@15/15.4/bin/pg_upgrade ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With