PostgreSQL 我可以从“组角色”继承 search_path 变量吗?
我知道我可以这样定义登录的 search_path 变量:
ALTER ROLE myrole SET search_path=public, foo, bar;
但是如果我使用很多登录,我也会使用组(pgadmin 中的组实际上是角色)。我想在组级别定义 search_path 变量,因此我删除了之前的 SET 并改为写道:
ALTER ROLE mygroup SET search_path=public, foo, bar;
只需将登录定义为组的成员
GRANT mygroup TO myrole
现在, SHOW search_path;
仅显示默认值搜索路径“$user”,public
。有没有办法定义组级别的变量(继承也是如此)?
I know I can define the search_path variable for a login this way:
ALTER ROLE myrole SET search_path=public, foo, bar;
But if I use a lot of logins I will also use groups (groups in pgadmin which are in fact roles). I would like to define the search_path variable on group level, so I remove this previous SET and instead wrote:
ALTER ROLE mygroup SET search_path=public, foo, bar;
And just define login as a member of the group
GRANT mygroup TO myrole
Now, a SHOW search_path;
show me only the default search-path "$user",public
. Is there a way to define variables for the group level (so with inheritance)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你不能那样做。 search_path 是一个变量,不是可授予的对象。
No you can't do that. The search_path is a variable not a grant-able object.