- create role
create role 'fleet-support-readonly';
- set password
ALTER USER user_name WITH PASSWORD 'new_password';
- grant login permission
ALTER ROLE "fleet-support-readonly" WITH LOGIN;
- switch to a database
\c <db_name>
- grant connect on a database
GRANT CONNECT ON DATABASE "stackenable-production" TO "fleet-support-readonly";
- grant readonly permission
GRANT SELECT ON ALL TABLES IN SCHEMA public TO "fleet-support-readonly";