I have created new Azure database for PostgreSQL - Flexible Server with admin user as "admin_demo".
Now after creating database I have done followoing steps:
create schema abc authorization admin_demo; -- creates new schema.
create role role_developer; -- creates new role.
grant usage, create on schema abc to role_developer; -- grant access to new role in schema.
grant select, insert, update, delete on all tables in schema abc to role_developer; -- grant access to new role in schema.
alter default privileges in schema abc grant select, insert, update, delete on tables to role_developer; -- grant access to new role in schema.
Now I created one user with name "dev_user" and assigned "role_developer" role created in above step no 2
Create the user(s) - create user dev_user with password 'xyz';
Assign role(s) to the user(s) - grant role_developer to dev_user;
Now I login into database with user "dev_user" and create table "demo_table". After that When I login into database with admin user i.e "admin_demo" and try to query the table "demo_table" created by user "dev_user" in above step, it throws me permission denied error.
My requirement here is "admin_demo" being the admin user should be able to anything(DDL/Alter etc) with any table in any schema throughout database irrespective of which user has created that table or function or procedure or sequence etc.
Can anyone help me with this ?