Search notes:

psql

sudo apt install -y postgresql-client

TODO

Connect to a given database

-d specifies the name of the database to connect to. Use postgres (the name of the default maintenance database) if this name is not kownn:
$ psql -h localhost -p 5432 -U admin -d postgres
After connecting, the available databases can be listed with \l.

Error message

$ psql
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?

See also

PostgreSQL

Index