pg_policy
是一个存储表行级安全 (RLS) 策略的系统目录表。
pg_policy
在PostgreSQL 9.5 中添加。
按 PostgreSQL 版本定义
pg_policy (PostgreSQL 17)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" PRIMARY KEY, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE CONSTRAINT, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 16)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" PRIMARY KEY, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE CONSTRAINT, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 15)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" PRIMARY KEY, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE CONSTRAINT, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 14)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" PRIMARY KEY, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE CONSTRAINT, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 13)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 12)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- oid | oid | | not null | polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | not null | polqual | pg_node_tree | C | | polwithcheck | pg_node_tree | C | | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 11)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | | polqual | pg_node_tree | | | polwithcheck | pg_node_tree | | | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 10)
Table "pg_catalog.pg_policy" Column | Type | Collation | Nullable | Default ---------------+--------------+-----------+----------+--------- polname | name | | not null | polrelid | oid | | not null | polcmd | "char" | | not null | polpermissive | boolean | | not null | polroles | oid[] | | | polqual | pg_node_tree | | | polwithcheck | pg_node_tree | | | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 9.6)
Table "pg_catalog.pg_policy" Column | Type | Modifiers --------------+--------------+----------- polname | name | not null polrelid | oid | not null polcmd | "char" | not null polroles | oid[] | polqual | pg_node_tree | polwithcheck | pg_node_tree | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
pg_policy (PostgreSQL 9.5)
Table "pg_catalog.pg_policy" Column | Type | Modifiers --------------+--------------+----------- polname | name | not null polrelid | oid | not null polcmd | "char" | not null polroles | oid[] | polqual | pg_node_tree | polwithcheck | pg_node_tree | Indexes: "pg_policy_oid_index" UNIQUE, btree (oid) "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
文档: pg_policy
更改历史记录
- PostgreSQL 10
- 添加了列
polpermissive
(提交 093129c9)
- 添加了列
- PostgreSQL 9.5
参考文献
- PostgreSQL 文档: pg_policy
另请参阅
pg_policies,行级安全