Home Explore Blog CI



postgresql

84th chunk of `doc/src/sgml/catalogs.sgml`
b8d0b694d5a5eccb5b4514611799796f87f8b21f3895a70f0000000100000fa2
 <type>char</type>
      </para>
      <para>
       A code defining the specific semantics of this dependency relationship; see text
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   In all cases, a <structname>pg_shdepend</structname> entry indicates that
   the referenced object cannot be dropped without also dropping the dependent
   object.  However, there are several subflavors identified by
   <structfield>deptype</structfield>:

   <variablelist>
    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_OWNER</symbol> (<literal>o</literal>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is the owner of the
       dependent object.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_ACL</symbol> (<literal>a</literal>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is mentioned in the
       <acronym>ACL</acronym> of the
       dependent object.  (A <symbol>SHARED_DEPENDENCY_ACL</symbol> entry is
       not made for the owner of the object, since the owner will have
       a <symbol>SHARED_DEPENDENCY_OWNER</symbol> entry anyway.)
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_INITACL</symbol> (<literal>i</literal>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is mentioned in a
       <link linkend="catalog-pg-init-privs"><structname>pg_init_privs</structname></link>
       entry for the dependent object.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_POLICY</symbol> (<literal>r</literal>)</term>
     <listitem>
      <para>
       The referenced object (which must be a role) is mentioned as the
       target of a dependent policy object.
      </para>
     </listitem>
    </varlistentry>

    <varlistentry>
     <term><symbol>SHARED_DEPENDENCY_TABLESPACE</symbol> (<literal>t</literal>)</term>
     <listitem>
      <para>
       The referenced object (which must be a tablespace) is mentioned as
       the tablespace for a relation that doesn't have storage.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>

   Other dependency flavors might be needed in future.  Note in particular
   that the current definition only supports roles and tablespaces as referenced
   objects.
  </para>

  <para>
   As in the <structname>pg_depend</structname> catalog, most objects
   created during <application>initdb</application> are
   considered <quote>pinned</quote>.  No entries are made
   in <structname>pg_shdepend</structname> that would have a pinned
   object as either referenced or dependent object.
  </para>

 </sect1>

 <sect1 id="catalog-pg-shdescription">
  <title><structname>pg_shdescription</structname></title>

  <indexterm zone="catalog-pg-shdescription">
   <primary>pg_shdescription</primary>
  </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

Title: pg_shdepend Dependency Types and Introduction to pg_shdescription
Summary
This section elaborates on the dependency types in `pg_shdepend`, including SHARED_DEPENDENCY_OWNER, SHARED_DEPENDENCY_ACL, SHARED_DEPENDENCY_INITACL, SHARED_DEPENDENCY_POLICY, and SHARED_DEPENDENCY_TABLESPACE. It explains that pg_shdepend entries indicate that the referenced object cannot be dropped without dropping the dependent object. Objects created during initdb are considered 'pinned' and are excluded from pg_shdepend entries. The section then introduces pg_shdescription, a shared catalog storing descriptions for shared database objects, similar to pg_description for single-database objects. pg_shdescription is shared across all databases in a cluster.