Connect to Postgres Databases With psql
November 2021
The default way to connect to post gres is:
psql postgreswhich connects to the postgres database as the current user you're runnig on the command line
To connect to a specific database as a specific user (aka role), use:
psql -U user_name -d database_nameTo connect to the root database with the root user, do this:
psql -U postgresend of line