Connect to Postgres Databases With psql
November - 2021
To connect to a specific database as a specific user (aka role), use:
psql -U user_name -d database_name
To connect to the root database with the root user, do this:
psql -U postgres
To connect to a specific database as a specific user (aka role), use:
psql -U user_name -d database_name
To connect to the root database with the root user, do this:
psql -U postgres