Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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. Just check with psql or pgAdmin if you are in doubt.

share|improve this answer
Thanks @Erwin_Brandstetter! Another excellent answer from you, I sure appreciate it. – Rob Bednark Jul 25 '12 at 15:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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