I have an existing 8.4 cluster (named main) that I want to upgrade to 9.1. However, when I go to upgrade it, I get an error because 9.1 already has a cluster named main (apparently a default cluster that is created when I did a sudo apt-get install postgresql-9.1-postgis):

$ pg_upgradecluster 8.4 main
Error: target cluster 9.1/main already exists

What should I do?
Remove the default 9.1/main cluster? How?
Rename the 9.1/main cluster? How?

Is there anything special about the Postgresql default main cluster?

Ubuntu 11.10 Oneiric, Postgresql 8.4.8 and 9.1.4

Update: I just found this AskUbuntu question-and-answer that says to first do a pg_dropcluster --stop 9.1 main I tried that and it worked. So now I'm wondering if there's any data, configuration settings, etc. in the default 9.1 main cluster that I might be losing by dropping it?

1 Answer 1


If the existing main is the default cluster that was created with your installation you can just drop it. Use the tool provided by your installation:

pg_dropcluster --stop 9.1 main

More info: man pg_dropcluster

There is nothing special about the main cluster. It's just a cluster like any other which happens to be the default in your installation.

If you haven't worked with the cluster yet, there is nothing in there, that you would lose. But check with psql or pgAdmin (or a client of your choosing) to make sure.

  • Thanks @Erwin_Brandstetter! Another excellent answer from you, I sure appreciate it. Jul 25, 2012 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.