pg_policy

A system catalogue table storing row level security policies for tables

pg_policy is a system catalogue table storing row level security policies for tables.

pg_policy was added in PostgreSQL 9.5 (initial commit 491c029d).

Definition by PostgreSQL version

pg_policy (PostgreSQL 13)

                 Table "pg_catalog.pg_policy"
    Column     |     Type     | Collation | Nullable | Default
---------------+--------------+-----------+----------+---------
 oid           | oid          |           | not null |
 polname       | name         |           | not null |
 polrelid      | oid          |           | not null |
 polcmd        | "char"       |           | not null |
 polpermissive | boolean      |           | not null |
 polroles      | oid[]        |           | not null |
 polqual       | pg_node_tree | C         |          |
 polwithcheck  | pg_node_tree | C         |          |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

pg_policy (PostgreSQL 12)

                 Table "pg_catalog.pg_policy"
    Column     |     Type     | Collation | Nullable | Default
---------------+--------------+-----------+----------+---------
 oid           | oid          |           | not null |
 polname       | name         |           | not null |
 polrelid      | oid          |           | not null |
 polcmd        | "char"       |           | not null |
 polpermissive | boolean      |           | not null |
 polroles      | oid[]        |           | not null |
 polqual       | pg_node_tree | C         |          |
 polwithcheck  | pg_node_tree | C         |          |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

pg_policy (PostgreSQL 11)

                 Table "pg_catalog.pg_policy"
    Column     |     Type     | Collation | Nullable | Default
---------------+--------------+-----------+----------+---------
 polname       | name         |           | not null |
 polrelid      | oid          |           | not null |
 polcmd        | "char"       |           | not null |
 polpermissive | boolean      |           | not null |
 polroles      | oid[]        |           |          |
 polqual       | pg_node_tree |           |          |
 polwithcheck  | pg_node_tree |           |          |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

pg_policy (PostgreSQL 10)

                 Table "pg_catalog.pg_policy"
    Column     |     Type     | Collation | Nullable | Default
---------------+--------------+-----------+----------+---------
 polname       | name         |           | not null |
 polrelid      | oid          |           | not null |
 polcmd        | "char"       |           | not null |
 polpermissive | boolean      |           | not null |
 polroles      | oid[]        |           |          |
 polqual       | pg_node_tree |           |          |
 polwithcheck  | pg_node_tree |           |          |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

pg_policy (PostgreSQL 9.6)

      Table "pg_catalog.pg_policy"
    Column    |     Type     | Modifiers
--------------+--------------+-----------
 polname      | name         | not null
 polrelid     | oid          | not null
 polcmd       | "char"       | not null
 polroles     | oid[]        |
 polqual      | pg_node_tree |
 polwithcheck | pg_node_tree |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

pg_policy (PostgreSQL 9.5)

      Table "pg_catalog.pg_policy"
    Column    |     Type     | Modifiers
--------------+--------------+-----------
 polname      | name         | not null
 polrelid     | oid          | not null
 polcmd       | "char"       | not null
 polroles     | oid[]        |
 polqual      | pg_node_tree |
 polwithcheck | pg_node_tree |
Indexes:
    "pg_policy_oid_index" UNIQUE, btree (oid)
    "pg_policy_polrelid_polname_index" UNIQUE, btree (polrelid, polname)
    

Documentation: pg_policy

Change history

Categories

Security, System catalogue

See also

pg_policies, row level security