5

I'm upgrading a PostgreSQL 9.5 cluster to 9.6 using pg_upgradecluster. It's taking an awful lot of time, so I'd like to cancel the process, delete unneeded databases, and start again. What are the risks?

1 Answer 1

7

By default, pg_upgradecluster doesn't use pg_upgrade. It's creating a logical dump with pg_dump and restoring it (with pg_restore) on the new cluster.

To avoid this and speed up the process, you need to add the -m upgrade option. If you need to speed up the process once more, you can add the --link so that the upgarde will be inplace. Be carefull, you can't cancel the process if you did it or you will loose your cluster.

If you didn't use the -m upgrade option and the --link option, you can cancel the process, drop the new cluster and create it again:

pg_dropcluster 9.6 <cluster_name>
pg_createcluster 9.6 <cluster_name>
1
  • 2
    Thanks very much. I eventually did cancel the process (not using -m upgrade or --link, thankfully) and found one gotcha: it totally hosed the pg_hba.conf for both the old and new server (I guess it was locking things down for the duration of the upgrade?) It backs it up to pg_hba.conf.pg_upgradecluster though. May 15, 2017 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.