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:

  1. Making gdk doctor check the PostgreSQL data version matches the current version
  2. Provide guidance on how to recover this:
    1. Either blow away the database entirely and reinit it
    2. 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)
    3. 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