I've installed postgresql on Ubuntu 21.04.
when I want to use it with psql command I got this error:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
update 1
I had postgres before. today I tried to use it and I got this error, so I remove everything about postgres using sudo apt remove postgresql-13 postgresql-client-13 postgresql-client-common postgresql-14 postgresql-client-14 postgresql-common and installed postgres by sudo apt install postgresql .
in tutorials, they install postgres and start using it without any configurations but I can't do that.
update 2
output of pg_lsclusters command:
Ver Cluster Port Status Owner Data directory Log file
13 main 5432 down,binaries_missing postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
14 main 5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
. So did you start the server? Inpostgresql.conf` isportset to5432? Further information: How did you install Postgres? Do you have more then one instance of Postgres running? Add answers as update to your question.pg_lsclustersshow? Add as update to your question.5433. The one that is set up for port5432does not have binaries installed. Your choices arepsql -p 5433, install the Postgres 14 binaries or change the Postgres 13 server to listen on port5432.psql -p 5433command I got this error:psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5433" failed: FATAL: role "smjt2000" does not exist. how I can change the Postgres 13 port to 5432 ?