I have master-slave-slave setup for postgresql 9.0.4 in our production setup. We need to upgrade it to latest (11.X), so my question is what would be the procedure to do so with as little downtime as possible.

Also what options (method wise) i have to upgrade it.


The fastest way will be pg_upgrade with the -k option.

This way. you can get away with a few minutes down time, which is required to move the database metadata.

If you cannot afford a few minutes down time, you will have to resort to a trigger based replication method like Slony. This way, you can replicate the database to a current version and switch the application over once replication has caught up.

| improve this answer | |
  • Just as a matter of interest, why didn't you recommend barman as the replication solution? – Vérace Sep 24 '19 at 7:42
  • That's a backup tool that can also prepare a streaming replication standby, but streaming replication cannot be used for major version upgrades, because you can only replicate between servers of the same major version. – Laurenz Albe Sep 24 '19 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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