暂无图片
postgre数据库pg_namespace视图的疑问,请问=UC/postgres是什么意思?
我来答
分享
yueli34
2024-06-15
postgre数据库pg_namespace视图的疑问,请问=UC/postgres是什么意思?

erp=> select * from pg_namespace;
oid | nspname | nspowner | nspacl
-------+--------------------+----------+-------------------------------------
99      | pg_toast                   | 10 |
12314 | pg_temp_1              | 10 |
12315 | pg_toast_temp_        1 | 10 |
11       | pg_catalog              | 10 | {postgres=UC/postgres,=U/postgres}
2200 | public                         | 10 | {postgres=UC/postgres,=UC/postgres}
13293 | information_schema | 10 | {postgres=UC/postgres,=U/postgres}


请问public这一行 {postgres=UC/postgres,=UC/postgres}

中=UC/postgres是什么意思?

谢谢!

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
清风生

被授予用户名=权限缩写/授予用户,例如,postgres=UC/postgres则表示postgres具有对象上的UC权限(U表示Usage、C表示Create,即可以在public,schema中建表),是由postgres用户授予的;

如果被授予用户名为空,则表示被授予的用户角色是public,例如,postgres=UC/postgres则表示public具有对象上的UC权限

暂无图片 评论
暂无图片 有用 2
暂无图片
小满未满、

postgres是用户名 UC的话是USAGE和CREATE的缩写 其实就是acl权限

感兴趣可以看看这里的文档

https://www.postgresql.org/docs/15/ddl-priv.html

或者这样子玩玩

CREATE USER test SUPERUSER;\c - test
CREATE SCHEMA sch_test;
SELECT * FROM pg_namespace;  
GRANT USAGE ON SCHEMA sch_test TO test;
SELECT * FROM pg_namespace;  
暂无图片 评论
暂无图片 有用 2
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏