postgresql Postgres 9.1 GRANT 不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9446745/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-20 23:40:07 来源:igfitidea点击:
Postgres 9.1 GRANT does not work
提问by zie1ony
I try to grant privileges like that:
我尝试授予这样的特权:
zielony=# GRANT ALL PRIVILEGES ON DATABASE baza_tag to strona_user;
GRANT
But nothing happends:
但什么也没发生:
usename | usesysid | usecreatedb | usesuper | usecatupd | userepl | passwd | valuntil | useconfig
-------------+----------+-------------+----------+-----------+---------+----------+----------+-----------
postgres | 10 | t | t | t | t | ******** | |
zielony | 16384 | t | t | t | t | ******** | |
strona_user | 16440 | f | f | f | f | ******** | |
Also I don't have any access via php. What am i missing?
此外,我没有任何通过 php 访问的权限。我错过了什么?
回答by Eelke
Postgresql rights system doesn't work like that. You will have to set rights on the objects them selves. Like so:
Postgresql 权限系统不是这样工作的。您必须自行设置对象的权限。像这样:
GRANT ALL ON ALL TABLES IN SCHEMA public TO strona_user;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO strona_user;
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO strona_user;