PostgreSQL 8.3 权限未更新 - 错误用法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/75696/
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
PostgreSQL 8.3 privileges not updated - wrong usage?
提问by sirprize
I'm having trouble granting privileges to another user in PostgreSQL 8.3. While the GRANT command gives me no error, the privileges do not show up. Do I need to "flush" them?
我在向 PostgreSQL 8.3 中的另一个用户授予权限时遇到问题。虽然 GRANT 命令没有给我任何错误,但没有显示权限。我需要“冲洗”它们吗?
sirprize=# CREATE DATABASE testdb;
CREATE DATABASE
sirprize=# GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser;
GRANT
sirprize=# \c testdb
You are now connected to database "testdb".
testdb=# \z
Access privileges for database "testdb"
Schema | Name | Type | Access privileges
--------+------+------+-------------------
(0 rows)
testdb=#
回答by Flimzy
\zShows your table, view, and sequence permissions, for the objects contained within the Database. It does not show permissions on the database itself. If you create a table or some other object within 'testdb', it will then show up in \z's output.
\z显示您对数据库中包含的对象的表、视图和序列权限。它不显示对数据库本身的权限。如果您在 'testdb' 中创建一个表或某个其他对象,它将显示在\z's 输出中。
You can see which Databases exist on your system with \l(or \l+for a bit more info).
您可以使用\l(或\l+更多信息)查看系统上存在哪些数据库。
See section 9.22. of the PostgreSQL 8.3 manualfor information about how to programatically determine which permissions exist for a user on a given database.
见第 9.22 节。PostgreSQL 8.3 手册的有关如何以编程方式确定给定数据库上的用户存在哪些权限的信息。

