PostgreSQL 14 ← 13
SYSTEM CATALOG · System catalog
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.
Checked column by column against a PostgreSQL 18.6 instance · Raw measurement record ↗
Columns PostgreSQL 18
pg_policy| COLUMN | TYPE | DESCRIPTION |
|---|---|---|
oid |
oidNOT NULL |
Row identifier |
polname |
nameNOT NULL |
The name of the policy |
polrelid |
oidNOT NULL |
The table to which the policy appliesReferences:pg_class.oid |
polcmd |
"char"NOT NULLDocumented as:char |
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 |
booleanNOT NULLDocumented as:bool |
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)References:pg_authid.oid |
polqual |
pg_node_tree |
The expression tree to be added to the security barrier qualifications for queries that use the table |
polwithcheck |
pg_node_tree |
The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table |
Columns marked "implicit" are not included in SELECT *; some early statistics views are completed from same-version source, and the extra provenance is shown in the column description.
Common system columns 6
System attributes PostgreSQL provides, normally not expanded by SELECT *. Kept separately so they are not mixed in with ordinary columns.
| Columns | Type | attnum |
|---|---|---|
tableoid | oid | -6 |
cmax | cid | -5 |
xmax | xid | -4 |
cmin | cid | -3 |
xmin | xid | -2 |
ctid | tid | -1 |
Column evolution matrix
Hover a cell for the column type9.0 is the coverage baseline; a column already present in the baseline is not marked as added. The matrix aligns columns by name, so a rename appears as the old column removed and a new column added.
Evolution timeline
Changes between adjacent majorsPostgreSQL 13 ← 12
PostgreSQL 12 ← 11
PostgreSQL 10 ← 9.6
PostgreSQL 9.5 ← 9.4Catalog added
Compare any two versions
Pick two versions to see added, removed, and retyped columns. The interactive comparison needs JavaScript; the evolution timeline reads fine without it.