petere / homebrew-postgresql

🐘 PostgreSQL formulae for the Homebrew package manager
295 stars 34 forks source link

pg_upgrade only to 9.5 #28

Closed alpracka closed 7 years ago

alpracka commented 7 years ago

Hi, I'm trying to upgrade postgresql 9.5 to 9.6, but the pg_upgrade utility seems to be not updated with 9.6 formula - supporting 9.5 as the latest version.

Steps:

1) I was running 9.5 version. I've run brew upgrade which installed 9.6 version (I've run also brew cleanup after upgrade, ignoring after install message) 2) I couldn't start postgresql because of version mismatch. I've figured out that 9.6 was installed. 3) I've moved mv /usr/local/var/postgres /usr/local/var/postgres9.5 and I've installed brew install postgresql95 4) Then I reinstalled brew reinstall postgresql so the new /usr/local/var/postgres dir for 9.6 version was created. 5) Script below failed, I tried logout / restart, did not help.

pg_upgrade \
>   --old-datadir=/usr/local/var/postgres9.5 \
>   --new-datadir=/usr/local/var/postgres \
>   --old-bindir=/usr/local/Cellar/postgresql95/9.5.5/bin \
>   --new-bindir=/usr/local/Cellar/postgresql/9.6.1/bin \
>   --verbose
Running in verbose mode
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   
This utility can only upgrade to PostgreSQL version 9.5.
Failure, exiting!

Thanks for help.

alpracka commented 7 years ago

No way, I missed linking - sorry for issuing, this helped:

brew unlink postgresql95 brew link postgresql

coisnepe commented 6 years ago

For what it's worth, here's what worked for me: https://gist.github.com/olivierlacan/e1bf5c34bc9f82e06bc0