最佳答案
我第一次尝试创建 Postgres 数据库。
我为 DB 角色分配了基本的只读权限,它必须通过 PHP 脚本访问数据库,我有一个好奇心: 如果我执行
GRANT some_or_all_privileges ON ALL TABLES IN SCHEMA schema TO role;
还需要执行这个吗?
GRANT USAGE ON SCHEMA schema TO role;
来自 文件:
用法: 对于模式,允许访问 指定的模式(假设对象自己的特权 基本上,这可让受让人 “查找”模式中的对象。
我认为,如果我可以选择或操作模式中包含的任何数据,我就可以访问模式本身的任何对象。我说错了吗?如果没有,GRANT USAGE ON SCHEMA
是用来做什么的?文档中的“假设对象自己的特权需求也得到满足”到底意味着什么?