Grant privileges to all users, current and future

爷,独闯天下 提交于 2019-12-10 16:58:08

问题


I have a multi-schema, multi-user Postgres DB. There is one table that I would like ALL users, both current and future, to be able to SELECT from.

I can GRANT SELECT to all current users... but how can I create a table that allows any future user to select? Is there a way to set table permissions, rather than granting user privileges?

A filesystem analogy would be using chmod to make a file to be readable by the public.


回答1:


grant select on the_table to public;

From the manual:

The key word PUBLIC indicates that the privileges are to be granted to all roles, including those that might be created later. PUBLIC can be thought of as an implicitly defined group that always includes all roles



来源:https://stackoverflow.com/questions/14246322/grant-privileges-to-all-users-current-and-future

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