Postgres error: No existing local cluster is suitable as a default target

If you don't care what your default cluster is, and just want things to work like they did before, just specify the port you want to connect to with

psql -p 5432

and postgres won't try to be clever for you and use a "cluster", whatever that is.


Just set PGCLUSTER

export PGCLUSTER=9.4/main

As none of your clusters listens on the default port 5432, psql (which is in fact a link to pg_wrapper) doesn't know which one should be the "default".

You may use psql --cluster 9.4/apps [other arguments] to access the first cluster and psql --cluster 9.4/main [other arguments] for the second one.

Or alternatively define a $PGCLUSTER environment variable to 9.4/apps or 9.4/main

These come from rules #2 and #4 (out of 8) of pg_wrapper manpage.

Tags:

Postgresql