向当前和将来的所有用户授予特权 [英] Grant privileges to all users, current and future

查看:94
本文介绍了向当前和将来的所有用户授予特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个多模式,多用户的Postgres DB。我希望有一张表可供所有当前和将来的用户使用。

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.

我可以将SELECT授予所有当前用户...但是如何创建允许将来的任何用户选择的表?有没有一种方法来设置表权限,而不是授予用户权限

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?

使用文件系统类比 chmod 使文件可以被公众阅读。

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

推荐答案

grant select on the_table to public;

从手册中


关键字PUBLIC表示将特权授予所有角色,包括以后可能创建的角色。可以将PUBLIC视为一个隐式定义的组,该组始终包含所有角色

这篇关于向当前和将来的所有用户授予特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆