acess postgres via command line code example
Example 1: how to access postgres CLI
# User postgres is default. It then may ask you for password.
psql -U postgres
Example 2: open postgres in terminal
sudo -i -u postgres psql
# User postgres is default. It then may ask you for password.
psql -U postgres
sudo -i -u postgres psql