Data redaction system catalogs v18

System catalogs store the redaction policy information.

pg_redaction_policy

The catalog data_redaction.pg_redaction_policy stores information about the redaction policies for tables.

ColumnDescription
rppolicyidThe unique number to identify a data retention policy. The value in this field is added by a sequence.
rpnameThe name of the data redaction policy.
rprelnameThe relation on which redaction policy is created.
rprelschemaSchema name in which the relation resides.
rpenableStatus of the redaction policy. The default value is true. If the value is true means the policy is enabled and active. If the value is false means the policy is disabled and inactive.
rpexprThe data redaction policy expression. If the expression is evaluated true then the policy is applied.
rpsearchpathThe value of search path set while creating the redaction policy.
Note

The data redaction policy applies for the relation if it's enabled and the expression ever evaluated true.

pg_redaction_column

The data_redactionp.pg_redaction_column system catalog stores information about the data redaction policy attached to the columns of a table.

ColumnDescription
rcpolicyidThe unique number to identify a data redaction policy.
rcrelnameThe relation on which redaction policy is created.
rcrelschemaSchema name in which the relation resides.
rcattnameRelation's column name having the redaction policy.
rcscopeThe scope defined for the redaction policy.
rcexceptionThe exception defined for the redaction policy.
rcfuncexprThe redaction function name that defines on how to redact the data.
Note

The described column is redacted if the redaction policy data_redaction.pg_redaction_column.rcpolicyid on the table is enabled and the redaction policy expression data_redaction.pg_redaction_policy.rpexpr evaluates to true.

redaction_policy_status

The redaction_policy_status view shows the health of all current data redaction policies, reporting a status of either Valid or Invalid.

A Valid status means the policy is correctly configured and all required underlying objects (like functions or tables) are present.

An Invalid status indicates that the policy cannot be properly applied because one or more of its necessary objects are missing or no longer exist.