I am new to postgres and am seeing an ownership/accessibility issue where we have 2 users, master and user_rw in the db. The tables table_abc => created owned by master table_xyz => created and owned by user_rw
The issue: Any new tables created by master are not accessible (select *, write etc) to user_rw and vice versa. I dont want to explicitly grant permissions for new tables to both users every time new tables are created.
I want the following requirements:
- All tables created by user_rw should be accessible and read/writable by user master
- All tables created by user master should be accessible and read/writable by user user_rw
- Any new tables created in the db hence forth should automatically be accessible (read/writable) by both users
I only have public schema in my postgres. While creating the user_rw I had done the following
GRANT CONNECT ON DATABASE database_test TO user_rw;
GRANT USAGE ON SCHEMA public TO user_rw;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO user_rw;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO user_rw;
What am I missing?