While migrating from Debian Squeeze to Debian Wheezy...
Install version 9.1 of the PostgreSQL server
sudo apt-get install postgresql-9.1
Stop the 9.1 database cluster
(It's not serving anything yet.)
sudo -u postgres pg_ctlcluster 9.1 main stop
Drop the newly created 9.1 database cluster
sudo -u postgres pg_dropcluster 9.1 main
Upgrade the 8.4 cluster to 9.1
NB the order of the versions in the command:
sudo -u postgres pg_upgradecluster -v 9.1 8.4 main
Drop the (old) 8.4 cluster
sudo -u postgres pg_dropcluster 8.4 main
Remove the 8.4 server package
sudo apt-get remove -s postgresql-8.4