PostgreSQL 8.3 privileges not updated - wrong usage?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 13:02:37

问题


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?

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=#

回答1:


\z Shows 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.

You can see which Databases exist on your system with \l (or \l+ for a bit more info).

See section 9.22. of the PostgreSQL 8.3 manual for information about how to programatically determine which permissions exist for a user on a given database.



来源:https://stackoverflow.com/questions/75696/postgresql-8-3-privileges-not-updated-wrong-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!