sql - Grant an automatic select to a all tables / PostgreSQL -


i have production database, user can create set of tables inherits master table x. matter when want apply automatic grant tables;

naturally command : grant select on tables in schema public read_only ; applied tables have been created.

the aim, applied command newest tables.

nb : tried make trigger on tables pg_class, pg_namespace it's impossible , it's same pg_tables view;

you can set default grants newly created objects alter default privileges command, e.g.:

alter default privileges user creator_role in schema public grant select on tables read_only; 

as aside, while can't install triggers on system catalogs, can achieve same thing (in postgres 9.3+) event triggers, fire on create/drop/alter statement.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -