PostgreSQL Version Upgrade


#1

TLDR; Update your local development environment to PostgreSQL 10 or above.

As of https://github.com/ManageIQ/manageiq/pull/18468 ManageIQ is now primarily running on PostgreSQL version 10.

This is a notice that soon we will implement a check for the database version which will warn developers if they are using a non-supported version.

That PR contains some changes which are not backwardly compatible with earlier versions of PostgreSQL, but the changes made should not greatly effect most devs as folks upgrade their local environments.

Also for PG 10 on the appliance, we have moved to a distribution which is installed in the system default location rather than using the distribution from https://www.softwarecollections.org.


#2

If you’re on a Mac and using brew to manage your postgres, the following is what I did to upgrade:

# assuming previous was installed as postgresql@9.5
brew services stop postgresql@9.5
brew install postgresql@10
/usr/local/Cellar/postgresql@10/10.6_1/bin/pg_upgrade -b /usr/local/Cellar/postgresql/9.5.3/bin -B /usr/local/Cellar/postgresql@10/10.6_1/bin  -d /usr/local/var/postgresql@9.5 -D /usr/local/var/postgresql@10
brew services start postgresql@10
./analyze_new_cluster.sh
# Make sure you can connect with your tools
./delete_old_cluster.sh
rm -f analyze_new_cluster.sh delete_old_cluster.sh
brew uninstall postgresql@9.5
# Note that postgresql@9.5 maybe be "pinned"
#   so you might need to `brew unpin postgresql@9.5` and try again
brew link --force postgresql@10