First you can connect with your postgres database using the postgre.app on mac or using postico.
Run the following command:
psql -h localhost -p port_number -d database_name -U user_name -W
then you enter your password, this should give access to your database