I need to achieve the below goal in postgresql. There is a database "textdb" with 4 schema's that are public, ds, fin, viz.
We need to create a script that can be used to provide access to the role. So, I need to create 3 roles, one for analyst, another for data scientist, and last one for visualization people.
CREATE ROLE analyst WITH LOGIN;
CREATE ROLE ds WITH LOGIN;
CREATE ROLE vi WITH LOGIN;
The respective team members will be added to their respective roles so that we need not to get access to individual users. Analyst is required to get complete access of the database "testdb", ds role will have access to all the data in the schema "ds" and "fin" and vi role will have access to schema "viz".
Also, whenever new table/view/procedure/function is added, then automatically users should have the required access.