
1. create a new role try first as user cashu)
create role cashRole with admin cashu;

2. then try the same statement as user postgres
create role cashRole with admin cashu;

3. login as user cashu99 and try to query a table in schema cash
select count(*) from cash.reservation;
--ERROR:  permission denied for schema cash
--LINE 1: select count(*) from cash.reservation;

4. login as user cashu and grant access to role cashRole:
grant usage on schema cash to cashRole;
grant select, insert, update, delete on all tables in schema cash to cashRole;

5. grant role cashRole to user cashu99
grant cashRole to cashu99;

6. now login as user cashu99 and try again
select count(*) from cash.reservation;


