pg_policy
The catalog pg_policy stores row-level security policies for tables. A policy includes the kind of command that it applies to (possibly all commands), the roles that it applies to, the expression to be added as a security-barrier qualification to queries that include the table, and the expression to be added as a WITH CHECK option for queries that attempt to add new records to the table.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- kind
- catalog
- lang
- en
- measured attributes
- true
- metadata release
- 18.6
- runtime columns
- oid, polname, polrelid, polcmd, polpermissive, polroles, polqual, polwithcheck
- runtime verified
- false
- source
- english-manual
Definition PG 18
The catalog pg_policy stores row-level security policies for tables. A policy includes the kind of command that it applies to (possibly all commands), the roles that it applies to, the expression to be added as a security-barrier qualification to queries that include the table, and the expression to be added as a WITH CHECK option for queries that attempt to add new records to the table.
Catalog columns
| Column | Type | Nullability | Description |
|---|---|---|---|
| oid | oid | Not null | Row identifier |
| polname | name | Not null | The name of the policy |
| polrelid | oid | Not null | The table to which the policy applies |
| polcmd | char | Not null | The command type to which the policy is applied: r for SELECT, a for INSERT, w for UPDATE, d for DELETE, or * for all |
| polpermissive | bool | Not null | Is the policy permissive or restrictive? |
| polroles | oid[] | Not null | The roles to which the policy is applied; zero means PUBLIC (and normally appears alone in the array) |
| polqual | pg_node_tree | Nullable | The expression tree to be added to the security barrier qualifications for queries that use the table |
| polwithcheck | pg_node_tree | Nullable | The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table |
Compare versions
Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · catalog-bilingual-repair:42de3e3bd719ebeedb15d8647610ec54f0d5ca1615e298c0b6f67d0da32f54b8
Text language: en · catalog-bilingual-repair:42de3e3bd719ebeedb15d8647610ec54f0d5ca1615e298c0b6f67d0da32f54b8