了解PSQL的\ dp和\ z的输出

时间:2013-11-11 17:11:53

标签: postgresql psql

我在从PSQL中选择数据库时遇到问题。这是我感兴趣的表格的输出。有人可以为我解读访问权限吗?我知道arwdRxt意味着追加,读取,写入等等......语法让我感到困惑,在权限列中斜杠和等于究竟是什么意思?如果我的问题不明确,请告诉我。

                    Access privileges
 schema |     name      | type |    access privileges    
--------+---------------+------+-------------------------
 public | table_name    | view | amazonuser=arwdRxt/amazonuser+
        |               |      | readonly=r/amazonuser

2 个答案:

答案 0 :(得分:4)

在[docs]中有详细描述。 =之前的东西是谁拥有这些权限,/是谁是谁授予了这些权限。

[1] http://www.postgresql.org/docs/current/static/sql-grant.html

答案 1 :(得分:0)

来自docs

Privilege   Abbreviation    Applicable Object Types
SELECT      r (“read”)      LARGE OBJECT, SEQUENCE, TABLE (and table-like objects), table column
INSERT      a (“append”)    TABLE, table column
UPDATE      w (“write”)     LARGE OBJECT, SEQUENCE, TABLE, table column
DELETE      d               TABLE
TRUNCATE    D               TABLE
REFERENCES  x               TABLE, table column
TRIGGER     t               TABLE
CREATE      C               DATABASE, SCHEMA, TABLESPACE
CONNECT     c               DATABASE
TEMPORARY   T               DATABASE
EXECUTE     X               FUNCTION, PROCEDURE
USAGE       U               DOMAIN, FOREIGN DATA WRAPPER, FOREIGN SERVER, LANGUAGE, SCHEMA, SEQUENCE, TYPE