HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

What to do about upgrading "main" cluster from 8.4 to 9.1 when a 9.1 "main" already exists?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
mainwhatupgradingexistsalreadyaboutwhenfromcluster

Problem

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?

Solution

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.

Context

StackExchange Database Administrators Q#21430, answer score: 10

Revisions (0)

No revisions yet.