Upgrade PostgreSQL after upgrade to Ubuntu-7.0.4

Ubuntu-6.10 (Edgy) has PostgreSQL-8.1.6 installed.

When upgrading to Feisty, PostgreSQL 8.1 is not supported anymore. When booting into Feisty, 8.1.6 still works, but you should manually upgrade to 8.2.3. After a few upgrades, this seems to be the right way (at least for most of us, that just run 1 cluster):

  • apt-get install postgresql-8.2
  • pg_dropcluster –stop 8.2 main
  • pg_upgradecluster -v 8.2 8.1 main /var/lib/postgresql/8.2/main

If this works, you can delete the old cluster:

  • pg_dropcluster 8.1 main

That’s it!

update for Gutsy to Hardy upgrade

A similar story for the upgrade of Ubuntu-7.10 (Gutsy) to 8.04 (Hardy).
Gutsy has 8.2.9, Hardy has 8.3.3. After upgrading with do-release-upgrade
8.2.9 need to be manually upgraded to 8.3.3.
Doing so will create an empty 8.3.3 cluster, which needs to be dropped first.
Make sure the old 8.2.9 cluster is running (/etc/init.d/postgres-8.2 start)
when upgrading:


apt-get install postgresql-8.3
pg_dropcluster --stop 8.3 main
pg_upgradecluster -v 8.3 8.2 main /var/lib/postgresql-8.3/main

3 comments

  1. Thanks for the tip!

    Just wanted to mention that after the upgrade there’s no need to keep PostgreSQL-8.1, so you can remove it with:

    >> sudo apt-get remove postgresql-8.1

Leave a comment

Your email address will not be published. Required fields are marked *