pg_init_privs 是一个 系统目录 表,包含对象初始权限的信息。
此表设计的目的是为了让应用程序(例如 pg_dump)能够检测到权限何时已从默认值更改,并据此采取相应措施(例如,在转储的 DDL SQL 中显式插入权限命令)。
pg_init_privs 在 PostgreSQL 9.6 中被添加。
按 PostgreSQL 版本定义
pg_init_privs (PostgreSQL 19)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 18)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 17)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 16)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 15)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 14)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" PRIMARY KEY, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 13)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" UNIQUE, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 12)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" UNIQUE, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 11)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" UNIQUE, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 10)
Table "pg_catalog.pg_init_privs"
Column | Type | Collation | Nullable | Default
-----------+-----------+-----------+----------+---------
objoid | oid | | not null |
classoid | oid | | not null |
objsubid | integer | | not null |
privtype | "char" | | not null |
initprivs | aclitem[] | | not null |
Indexes:
"pg_init_privs_o_c_o_index" UNIQUE, btree (objoid, classoid, objsubid)
文档: pg_init_privs
pg_init_privs (PostgreSQL 9.6)
Table "pg_catalog.pg_init_privs"
Column | Type | Modifiers
-----------+-----------+-----------
objoid | oid | not null
classoid | oid | not null
objsubid | integer | not null
privtype | "char" | not null
initprivs | aclitem[] | not null
Indexes:
"pg_init_privs_o_c_o_index" UNIQUE, btree (objoid, classoid, objsubid)
文档: pg_init_privs
变更历史
自 PostgreSQL 9.6 添加以来,此表未发生更改。
- PostgreSQL 9.6
- 添加(提交 6c268df1)
参考资料
- PostgreSQL 文档: pg_init_privs
