Home Explore Blog CI



postgresql

85th chunk of `doc/src/sgml/catalogs.sgml`
7be81e3c2ea2d4797253fff8c0793785938069ffeae53e250000000100000fce
 </indexterm>

  <para>
   The catalog <structname>pg_shdescription</structname> stores optional
   descriptions (comments) for shared database objects.  Descriptions can be
   manipulated with the <link linkend="sql-comment"><command>COMMENT</command></link> command and viewed with
   <application>psql</application>'s <literal>\d</literal> commands.
  </para>

  <para>
   See also <link linkend="catalog-pg-description"><structname>pg_description</structname></link>,
   which performs a similar function for descriptions involving objects
   within a single database.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_shdescription</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_shdescription</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_shdescription</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>objoid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       The OID of the object this description pertains to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classoid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the system catalog this object appears in
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>description</structfield> <type>text</type>
      </para>
      <para>
       Arbitrary text that serves as the description of this object
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="catalog-pg-shseclabel">
  <title><structname>pg_shseclabel</structname></title>

  <indexterm zone="catalog-pg-shseclabel">
   <primary>pg_shseclabel</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_shseclabel</structname> stores security
   labels on shared database objects.  Security labels can be manipulated
   with the <link linkend="sql-security-label"><command>SECURITY LABEL</command></link> command.  For an easier
   way to view security labels, see <xref linkend="view-pg-seclabels"/>.
  </para>

  <para>
   See also <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>,
   which performs a similar function for security labels involving objects
   within a single database.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_shseclabel</structname>
   is shared across all databases of a cluster: there is only one
   copy of <structname>pg_shseclabel</structname> per cluster, not
   one per database.
  </para>

  <table>
   <title><structname>pg_shseclabel</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>objoid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       The OID of the object this security label pertains to
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classoid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)

Title: pg_shdescription Columns and Introduction to pg_shseclabel
Summary
This section details the columns of the `pg_shdescription` catalog: `objoid` (the OID of the described object), `classoid` (the OID of the system catalog the object is in), and `description` (arbitrary text describing the object). It then introduces the `pg_shseclabel` catalog, which stores security labels on shared database objects, similar to `pg_seclabel` for single-database objects. `pg_shseclabel` is also shared across all databases in a cluster.