Home Explore Blog CI



postgresql

83th chunk of `doc/src/sgml/catalogs.sgml`
8d5c7f9c68032f5a784d64ba7b27d6d1114cb6726e6a76770000000100000fa0
 involving objects
   within a single database.
  </para>

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

  <table>
   <title><structname>pg_shdepend</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>dbid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the database the dependent object is in,
       or zero for a shared object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classid</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 the dependent object is in
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       The OID of the specific dependent object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objsubid</structfield> <type>int4</type>
      </para>
      <para>
       For a table column, this is the column number (the
       <structfield>objid</structfield> and <structfield>classid</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>refclassid</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 the referenced object is in
       (must be a shared catalog)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>refobjid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       The OID of the specific referenced object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>deptype</structfield> <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
 

Title: pg_shdepend Columns and Dependency Types
Summary
This section describes the columns of the `pg_shdepend` catalog table, which tracks dependencies between database objects and shared objects: `dbid` (database OID), `classid` (system catalog OID of the dependent object), `objid` (OID of the dependent object), `objsubid` (column number for table columns, zero otherwise), `refclassid` (system catalog OID of the referenced object), `refobjid` (OID of the referenced object), and `deptype` (dependency type code). It also details the different dependency types indicated by the `deptype` column: `SHARED_DEPENDENCY_OWNER` ('o') and `SHARED_DEPENDENCY_ACL` ('a').