CANNOT GRANT CREATE VIEW ON SCHEMA

家住魔仙堡 提交于 2019-12-11 06:42:06

问题


I have a user in a database who only can select datas on all tables. I want to alow him to create views and not tables. Is it possible to grant to a specific user privileges for only creating views in a database schema?

Regards.


回答1:


Not in PostgreSQL at time of writing, no. The CREATE right in a schema lets them create any object type. There's no way to limit what objects they can create - functions, operators, operator classes, tables, views, etc.

You could implement an executor hook to enforce these kinds of rules, but you'll have to do it as a loadable module written in C. ProcessUtility_hook is probably the hook you want. There will be a significant learning curve to this approach, as you'll need to understand how PostgreSQL's statements are described in their internal parsed form.



来源:https://stackoverflow.com/questions/19811683/cannot-grant-create-view-on-schema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!