Summary
The view pg_policies provides access to useful information about each row-level security policy in the database.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_policies system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
schemanamenamereferencespg_namespace.nspname
Name of schema containing table policy is ontablenamenamereferencespg_class.relname
Name of table policy is onpolicynamenamereferencespg_policy.polname
Name of policypermissivetext
Is the policy permissive or restrictive?rolesname[]
The roles to which this policy appliescmdtext
The command type to which the policy is appliedqualtext
The expression added to the security barrier qualifications for queries that this policy applies towith_checktext
The expression added to the WITH CHECK qualifications for queries that attempt to add rows to this table
Related catalogs
This object references the following other system catalogs:
schemaname→pg_namespacetablename→pg_classpolicyname→pg_policy
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_policies.