If we only grant CONNECT to a database, the user can connect but has no other privileges. We have to grant USAGE on namespaces (schemas) and SELECT on tables and views individually like so:
1. Create User.
create user r2admin with password 'admin@123';
Continue reading How to create a read-only user in PostgreSQL