↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

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

ColumnTypeNullabilityDescription
oidoidNot nullRow identifier
polnamenameNot nullThe name of the policy
polrelidoidNot nullThe table to which the policy applies
polcmdcharNot nullThe command type to which the policy is applied: r for SELECT, a for INSERT, w for UPDATE, d for DELETE, or * for all
polpermissiveboolNot nullIs the policy permissive or restrictive?
polrolesoid[]Not nullThe roles to which the policy is applied; zero means PUBLIC (and normally appears alone in the array)
polqualpg_node_treeNullableThe expression tree to be added to the security barrier qualifications for queries that use the table
polwithcheckpg_node_treeNullableThe 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