pg_upgradecluster 8.2 main

February 12th, 2008

PostgreSQL 8.3 is here. After apt-get’ing it, the upgrade didn’t move the 8.2 cluster up. Having 8.2 running in a custom port, made 8.3 go use the standard 5432 port.
8.3 created a main cluster.

Check ports:
$ sudo netstat -anput | grep postgres

Check wich configuration files and wich versions are running:
$ ps -Af | grep postgres

pg_upgradecluster when upgrading the existing PostgreSQL cluster, will check ports of the new and old version (check both 8.2 and /etc/postgresql/8.3/main$ grep 'port' postgresql.conf), and make the newer version use the older version’s port number. Then the older version will use an available port number. This keeps the original Port # in use.

Stop and drop the newly created 8.3 main cluster:
$ sudo pg_dropcluster --stop 8.3 main

Time to upgrade the 8.2 main cluster to 8.3
$ sudo pg_upgradecluster 8.2 main

After checking everything is ok we could remove the older cluster:
$ sudo pg_dropcluster --stop 8.2 main

and “apt-get remove” the 8.2 version.

docs:
$ man pg_dropcluster
$ man pg_upgradecluster