↑↓ select ↵ open ⌫ change scope Open full search

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

System Catalogs / System catalogs

The catalog pg_policy stores row-level security policies for tables.

Reading PG 18current·documented in 13 of 24 versions, 9.5 to 20

Kind
System catalogs
Columns in this snapshot
8
Definition source
English manual
Metadata snapshot
18.6

Columns 8

As listed in the PostgreSQL 18 manual.

ColumnTypeDescription / reference
oidoidNOT NULLRow identifier
polnamenameNOT NULLThe name of the policy
polrelidoidNOT NULLThe table to which the policy applies
pg_class.oid
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)
pg_authid.oid
polqualpg_node_treeThe expression tree to be added to the security barrier qualifications for queries that use the table
polwithcheckpg_node_treeThe expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table
Column history across versions
Version history 5
  1. 13 → 14 reworded
  2. 12 → 13 reworded
  3. 11 → 12 changed
  4. 9.6 → 10 changed
  5. 9.4 → 9.5 added

Definition snapshot: english-manuals:309d32f7e91f87650377ac3ce54… · English manual source