roles/postgres: make the upgrade_pg.sh script more robust
Another thing that should probably be improved is the point at which the postgresql
and postgresql-libs
packages are upgraded. Currently that has to be done before running the upgrade_pg.sh
script, but then postgresql.service
may fail any time (but it probably won't cause database corruption).
This could be improved by adding the packages to IgnorePkg
and upgrading them from the upgrade_pg.sh
script along with postgresql-old-upgrade
, which is after postgresql.service
has been stopped. The condition at the start would have to be changed, since pacman -Q
would give the old version. I'm using TO_VERSION=$(expac -S "%v" postgresql)
in a personal script (which is based on yours), but expac
is probably not installed on Arch servers at the moment. The subcommand should also skip the potential version from [testing], since that won't be installed due to [testing] Usage=Search Sync
in pacman.conf.
CC @grazzolini