문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top