Postgresql - No PostgreSQL clusters exist; see "man pg_createcluster" during service restart

After the shutdown of the server PG was unable to start, the cluster (the instance of the database) was missing.

At the end I've been able to recover it. I had to correct something (see below) then I've executed :

sudo pg_createcluster 9.3 main

Then you should start it

sudo /etc/init.d/postgresql start

The system replied with : Configuring already existing cluster ....

Things to do in those cases : - check that all the configuration files and data files are in the correct folders - check that the files postmaster.opts are pointing to the correct locations

If the primary cluster (usually 'main') is still not starting you can create a new cluster with :

pg_createcluster 9.3 cluster2

Then restore the database backup to the new cluster.

Commands to control PG clusters :

list clusters

pg_lsclusters 

start/stop a cluster

pg_ctlcluster <pg version> <cluster name> <start|stop>
pg_ctlcluster 9.3 main start 
pg_ctlcluster 9.3 clust2 stop 

stop a cluster - drop active connections

pg_ctlcluster -m fast 9.3 clust2 stop