pg_policy
A system table storing row level security policies
pg_policy
is a system catalogue table storing row level security (RLS) policies for tables.
pg_policy
was added in PostgreSQL 9.5.
Definition by PostgreSQL version
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)
Documentation: 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)
Documentation: 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)
Documentation: 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)
Documentation: 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)
Documentation: 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)
Documentation: 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)
Documentation: 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)
Documentation: pg_policy
Change history
- PostgreSQL 10
- column
polpermissive
added (commit 093129c9)
- column
- PostgreSQL 9.5
References
- PostgreSQL documentation: pg_policy
Categories
See also
pg_policies, row level security