Login in psql
psql -U postgres -h localhost
See list of database
\l
See list of users with list of roles
\du
Create new user
CREATE USER <username> WITH ENCRYPTED PASSWORD '<password>';
Create new database
CREATE DATABASE <databasename> WITH OWNER <username>;
DELETE database
DROP DATABASE IF EXISTS <databasename>;
GRANT Privilages
GRANT ALL PRIVILAGES ON DATABASE <databasename> TO <username>;
Import a dump file
psql -U username -d database_name -f dump.sql