PostgreSQL Upgrade – How to Upgrade Postgres 9.3 to 9.4 After Ubuntu Upgrade

postgresqlpostgresql-9.3postgresql-9.4upgrade

I've just recently upgraded my Ubuntu install from 14.04 to 14.10. This automatically pushed Postgres 9.4 onto the system. I'm trying to migrate my cluster like this:

sudo pg_dropcluster 9.4 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main

However, after running the second command I get the following error:

Error: could not get cluster locales.

How do I fix this?
(PS Sorry if this is a stupid question, and please let me know what additional information is required)

PS: locale (lc_collate) returns en_US.UTF-8

Best Answer

I had the same error, I figured that the error was happening during shutdown of old cluster, it actually caused the cluster not to shut down fully.

What worked for me was stopping the old cluster manually and only then performing an upgrade.

sudo service postgresql stop
sudo pg_upgradecluster 9.3 main