Home Explore Blog CI



postgresql

45th chunk of `doc/src/sgml/catalogs.sgml`
db18dddff2f1c44e2d1fc13bd195d25a777cfe6c82fe73110000000100000fa0
 never allowed to be dropped.
   Also, knowing that pinned objects will not be dropped, the dependency
   mechanism doesn't bother to make <structname>pg_depend</structname>
   entries showing dependencies on them.  Thus, for example, a table
   column of type <type>numeric</type> notionally has
   a <literal>NORMAL</literal> dependency on the <type>numeric</type>
   data type, but no such entry actually appears
   in <structname>pg_depend</structname>.
  </para>

 </sect1>


 <sect1 id="catalog-pg-description">
  <title><structname>pg_description</structname></title>

  <indexterm zone="catalog-pg-description">
   <primary>pg_description</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_description</structname> stores optional descriptions
   (comments) for each database object.  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.
   Descriptions of many built-in system objects are provided in the initial
   contents of <structname>pg_description</structname>.
  </para>

  <para>
   See also <link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>,
   which performs a similar function for descriptions involving objects that
   are shared across a database cluster.
  </para>

  <table>
   <title><structname>pg_description</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>objsubid</structfield> <type>int4</type>
      </para>
      <para>
       For a comment on a table column, this is the column number (the
       <structfield>objoid</structfield> and <structfield>classoid</structfield> refer to
       the table itself).  For all other object types, this column is
       zero.
      </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-enum">
  <title><structname>pg_enum</structname></title>

  <indexterm zone="catalog-pg-enum">
   <primary>pg_enum</primary>
  </indexterm>

  <para>
   The <structname>pg_enum</structname> catalog contains entries
   showing the values and labels for each enum type. The
   internal representation of a given enum value is actually the OID
   of its associated row in <structname>pg_enum</structname>.
  </para>

  <table>
   <title><structname>pg_enum</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">
 

Title: pg_description Catalog and pg_enum Catalog
Summary
This section describes the pg_description catalog, which stores optional descriptions (comments) for database objects, manipulated with the COMMENT command and viewed with psql's \d commands. It includes the columns: objoid, classoid, objsubid, and description. It also covers the pg_enum catalog, which contains entries showing the values and labels for each enum type, and mentions that the internal representation of an enum value is the OID of its associated row in pg_enum.