Home Explore Blog CI



postgresql

69th chunk of `doc/src/sgml/catalogs.sgml`
c563df577bc00cf2b03f86a99040da4bd974b42a053b55200000000100000fa0
 <structfield>polcmd</structfield> <type>char</type>
      </para>
      <para>
       The command type to which the policy is applied:
       <literal>r</literal> for <xref linkend="sql-select"/>,
       <literal>a</literal> for <xref linkend="sql-insert"/>,
       <literal>w</literal> for <xref linkend="sql-update"/>,
       <literal>d</literal> for <xref linkend="sql-delete"/>,
       or <literal>*</literal> for all
      </para></entry>
     </row>

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

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>polroles</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The roles to which the policy is applied;
       zero means <literal>PUBLIC</literal>
       (and normally appears alone in the array)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>polqual</structfield> <type>pg_node_tree</type>
      </para>
      <para>
       The expression tree to be added to the security barrier qualifications for queries that use the table
      </para></entry>
     </row>

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

  <note>
   <para>
    Policies stored in <structname>pg_policy</structname> are applied only when
    <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relrowsecurity</structfield> is set for
    their table.
   </para>
  </note>

 </sect1>

 <sect1 id="catalog-pg-proc">
  <title><structname>pg_proc</structname></title>

  <indexterm zone="catalog-pg-proc">
   <primary>pg_proc</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_proc</structname> stores information about
   functions, procedures, aggregate functions, and window functions
   (collectively also known as routines).  See <xref
   linkend="sql-createfunction"/>, <xref linkend="sql-createprocedure"/>, and
   <xref linkend="xfunc"/> for more information.
  </para>

  <para>
   If <structfield>prokind</structfield> indicates that the entry is for an
   aggregate function, there should be a matching row in
   <link linkend="catalog-pg-aggregate"><structfield>pg_aggregate</structfield></link>.
  </para>

  <table>
   <title><structname>pg_proc</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>oid</structfield> <type>oid</type>
      </para>
      <para>
       Row identifier
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>proname</structfield> <type>name</type>
      </para>
      <para>
       Name of the function
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pronamespace</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The

Title: pg_policy Columns and pg_proc Catalog
Summary
This section details the remaining columns of the `pg_policy` catalog: `polroles` (roles the policy applies to), `polqual` (expression tree for security barrier qualifications), and `polwithcheck` (expression tree for WITH CHECK qualifications). It notes that policies are only applied if `pg_class.relrowsecurity` is set. It then introduces the `pg_proc` catalog, which stores information about functions, procedures, aggregate functions, and window functions. The section mentions the `prokind` and `pg_aggregate` relation and then lists the `oid` and `proname` columns within `pg_proc`.