首页 文章

PostgreSQL类型的默认权限

提问于
浏览
2

documentation for GRANT说:

PostgreSQL将某些类型的对象的默认权限授予PUBLIC . 默认情况下,对表,列,模式或表空间不授予PUBLIC权限 . 对于其他类型,授予PUBLIC的默认权限如下:CONNECT和CREATE TEMP TABLE for databases;函数的EXECUTE特权;和语言的USAGE特权 .

类型未被提及为获取默认权限,因此为什么我会看到以下内容:

> CREATE TYPE bug_status AS ENUM ('new', 'open', 'closed');
> REVOKE USAGE ON TYPE bug_status FROM postgres;
> \dT+ bug_status
                                        List of data types
 Schema |    Name    | Internal name | Size | Elements | Owner    | Access privileges | Description
--------+------------+---------------+------+----------+----------+-------------------+-------------
 public | bug_status | bug_status    | 4    | new     +| postgres | =U/postgres       |
        |            |               |      | open    +|          |                   |
        |            |               |      | closed   |          |                   |

我已经撤销了所有者的USAGE,但PUBLIC有这个特权 .

我错过了记录的地方吗?

1 回答

  • 1

    你是对的;看起来 PUBLIC 默认授予 USAGE 权限 .

    这是一个文档错误,I'll do something about it .

    EDIT: 该错误已通过this PostgreSQL提交修复 .

相关问题