Home Explore Blog CI



postgresql

24th chunk of `doc/src/sgml/system-views.sgml`
20e04cdfcfc61d4ee59d0a4afa7263766dd42d96493999f60000000100000fbd
 <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>ispopulated</structfield> <type>bool</type>
      </para>
      <para>
       True if materialized view is currently populated
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>definition</structfield> <type>text</type>
      </para>
      <para>
       Materialized view definition (a reconstructed <xref linkend="sql-select"/> query)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-policies">
  <title><structname>pg_policies</structname></title>

  <indexterm zone="view-pg-policies">
   <primary>pg_policies</primary>
  </indexterm>

  <para>
   The view <structname>pg_policies</structname> provides access to
   useful information about each row-level security policy in the database.
  </para>

  <table>
   <title><structname>pg_policies</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table policy is on
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table policy is on
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>policyname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link>.<structfield>polname</structfield>)
      </para>
      <para>
       Name of policy
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>permissive</structfield> <type>text</type>
      </para>
      <para>
       Is the policy permissive or restrictive?
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>roles</structfield> <type>name[]</type>
      </para>
      <para>
       The roles to which this policy applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>cmd</structfield> <type>text</type>
      </para>
      <para>
       The command type to which the policy is applied
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>qual</structfield> <type>text</type>
      </para>
      <para>
       The expression added to the security barrier qualifications for
       queries that this policy applies to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>with_check</structfield> <type>text</type>
      </para>
      <para>
       The expression added to the WITH CHECK qualifications for
       queries that attempt to add rows to this table
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-prepared-statements">
  <title><structname>pg_prepared_statements</structname></title>

  <indexterm zone="view-pg-prepared-statements">
   <primary>pg_prepared_statements</primary>

Title: Database Views: pg_policies and pg_prepared_statements
Summary
The pg_policies view provides information about row-level security policies in the database, including the schema name, table name, policy name, and the roles to which the policy applies. The columns of pg_policies include schemaname, tablename, policyname, permissive, roles, cmd, qual, and with_check, which provide details about each policy. The text also introduces the pg_prepared_statements view, although its details are not specified in this chunk.