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


4 Comments to “pg_upgradecluster 8.2 main”


  1. Tim said:

    This is exactly what I needed, you saved me about a days work!


  2. pedro said:

    glad to help ;)


  3. upgrade postgresql-8.1 to postgresql-8.3 in debian etch « Different.In a good way said:

    […] upgrade postgresql-8.1 to postgresql-8.3 in debian etch By paragasu postgresql-8.3 available for etch on backports repositories. Add to /etc/apt/sources.list deb http://www.backports.org/debian etch-backports main contrib non-free then install postgresql-8.3 #apt-get -t etch-backports install postgresql-8.3 #pg_dropcluster –stop 8.3 main #pg_upgradecluster 8.1 main #pg_dropcluster –stop 8.1 main #apt-get remove postgresql-8.1 read more […]


  4. marauder said:

    Heh, this saved me several hours as well, and did a much better job than I would have if I’d followed the instructions in the pg documentation…

Leave a Reply