暂无图片
询问权限
我来答
分享
Zixin Huo
2023-09-22
询问权限

在pg中想要授予test用户对public这个schema下的demo表的id列的查询权限,下面那个语句是正确的?
A
grant select (id,name) on public.demo to test;
B
grant select (id) on public.demo to test;
C
grant select on public.demo to test;
D
grant select on all tables in schema public to test;

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
C
CICi

在 PostgreSQL 中,要授予用户对特定表的查询权限,语法如下:

GRANT SELECT (column_name) ON table_name TO user_name;

因此,正确的语句是:

B. grant select (id) on public.demo to test;

这将授予用户 “test” 对 “public.demo” 表中 “id” 列的查询权限。

暂无图片 评论
暂无图片 有用 5
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏