postgres command to access database code example Example: access the postgres psql psql -h localhost -U username databasename