英文:
Grant rights to every table in a scheme every time a new table is created
问题
问题是当创建新表时,模式的用户无法访问它。
我想创建一个触发器,每当创建新表时都会启动。
每个用户都应该有对新表的读取权限。
我尝试了一些触发事件,但它们没有起作用...也许你可以帮助。
英文:
The problem is when new table is created, the user of the schema dont have access to it.
I want to create a trigger which is started everytime when a new table is being created.
Every user should have read rights to the new table.
I tried some trigger events but they didnt worked.. maybe you can help.
答案1
得分: 0
ALTER DEFAULT PRIVILEGES IN SCHEMA your_schema
GRANT SELECT ON TABLES TO your_user;
This role must have usage permissions on the schema as well.
英文:
Set default permissions for the new tables created in the future:
ALTER DEFAULT PRIVILEGES IN SCHEMA your_schema
GRANT SELECT ON TABLES TO your_user;
This role must have usage permissions on the schema as well.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论