I recently had to upgrade my PostgreSQL 7.4 to 8.0 in Debian and learned that there is a cool way of doing this. This procedure is described in /usr/share/doc/postgresql-common/architecture.html
.
In a nutshell:
- Install the new version in packages: postgresql-*-8.0. Mote that all the pg_* tools still point to the old versions.
- Make sure that both servers are up and running.
- Run: “pg_upgradecluster 7.4 main” to upgrade the old database to the new one.
- Now all the pg_* tools point to the new versions, also the new server will listen on the standard port. Check if everything works fine.
- Run “pg_dropcluster 7.4 main” to delete the old database.
Cool. I wonder how Gentoo does this