Make it easier to handle PostgreSQL upgrades
PostgreSQL on the GDK can fail if the default PostgreSQL is upgraded with the following error message:
2020-06-04_17:05:46.44795 postgresql : 2020-06-04 20:05:46.447 EEST [11926] DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.8.
We should consider:
- Making
gdk doctorcheck the PostgreSQL data version matches the current version - Provide guidance on how to recover this:
- Either blow away the database entirely and reinit it
- Run
pg_upgrade(Linux: https://wiki.postgresql.org/wiki/Using_pg_upgrade_on_Ubuntu/Debian, MacOS: https://dinhvle.com/2018/05/22/upgrading-postgresql-on-macos.html) - Downgrade PostgreSQL (e.g.
brew uninstall postgresql@11)
I wonder if it's worth automating the pg_upgrade.
Alternatively, we can think about how we might want to lock PostgreSQL versions because support/pg_bindir looks like it will use the latest version installed on macOS.
Edited by Stan Hu