Connect to Postgres Databases With psql

The default way to connect to post gres is:

Code
psql postgres

which 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:

Code
psql -U user_name -d database_name

To connect to the root database with the root user, do this:

Code
psql -U postgres