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

error: you must install at least one postgresql-client-<version> package
install postgresql ubuntu
install postgresql ubuntu 18
install postgresql linux
postgresql setup

I have an old project that I'm trying to get back into, but I can't enter postgres. Running sudo -u postgres psql gives me:

Error: No existing local cluster is suitable as a default target. 
Please see man pg_wrapper(1) how to specify one.

I'm wondering if this might be because I upgraded postgres to version 9.4 a few months back. This is my output for dpkg --get-selections |grep postgres:

postgresql                          install
postgresql-9.3                      install
postgresql-9.4                      install
postgresql-client-9.3               install
postgresql-client-9.4               install
postgresql-client-common            install
postgresql-common                   install
postgresql-contrib                  install
postgresql-contrib-9.3              install
postgresql-contrib-9.4              install
postgresql-server-dev-9.3           install

These are my current clusters from pg_lsclusters:

Ver Cluster Port Status Owner    Data directory               Log file
9.4 apps    5434 online postgres /var/lib/postgresql/9.4/apps /var/log/postgresql/postgresql-9.4-apps.log

9.4 main    5433 online postgres /var/lib/postgresql/9.4/main /var/log/postgresql/postgresql-9.4-main.log

What can I do to be able to access postgres again? Googling hasn't been much help.


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.

No existing local cluster is suitable error using pg_dump in docker , postgresql-client-common is a Ubuntu-specific package of scripts that allows users to work with multiple versions of Postgres (or multiple  Error: No existing local cluster is suitable as a default target. Please see man pg_wrapper(1) how to specify one. RAW Paste Data We use cookies for various purposes


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.

Postgres error: no existing local cluster is suitable as the default target, Since none of your clusters listens on the default port 5432 , psql (which is actually a link to pg_wrapper ) does not know which one should be "default". You can  When i use repmgr with any option it says that it can't find a suitable default target: $ repmgr -f /path/to/repmgr.conf master register Error: No existing local cluster is suitable as a default target. Please see man pg_wrapper(1) how to specify one.


Just set PGCLUSTER

export PGCLUSTER=9.4/main

Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No , Warning: No existing local cluster is suitable as a default target. Error: You must install at least one postgresql-client-<version> package If you you don't see 5432, but instead 5433 or 5434 it means postgres is not running on the default port. In that case edit /etc/postgresql/11/main/postgresql.conf and change "port = 5434" or whatever it is to "port = 5432", then restart postgresql server. If that doesn't work, try downgrading to postgresql 10 and see if that works


Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No , psql > Warning: No existing local cluster is suitable as a default target. > Please > see man pg_wrapper(1) how to specify one. > Error: You  14 Postgres error: No existing local cluster is suitable as a default target 9 Combining 3 boolean masks in Python 6 How to seat everyone according to preferences?


Upgrade Postgresql 9.1 to 9.2, --post=5433 --username=postgres --password --host=localhost --verbose Error: No existing local cluster is suitable as a default target. Please  Postgresql creates a default user called postgres, so login as default user and create a new user. sudo -i -u postgres createuser --interactive Then enter your linux username and select Yes for superuser option. Exit the postgre user by typing exit. With your user, create a new database by typing. createdb mydb


PostgreSQL is missing after reboot, When switching to user postgres and running psql I get the error. Warning: No existing local cluster is suitable as a default target. Please see  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. It only takes a minute to sign up. Sign up to join this community