Home Explore Blog CI



postgresql

41th chunk of `doc/src/sgml/catalogs.sgml`
89519fdc306b139584e1d588cfdec047fd8cfab64cd496030000000100000fad
 <quote>global</quote> entries with
   <structfield>defaclnamespace</structfield> = zero, and <quote>per-schema</quote> entries
   that reference a particular schema.  If a global entry is present then
   it <emphasis>overrides</emphasis> the normal hard-wired default privileges
   for the object type.  A per-schema entry, if present, represents privileges
   to be <emphasis>added to</emphasis> the global or hard-wired default privileges.
  </para>

  <para>
   Note that when an <acronym>ACL</acronym> entry in another catalog is null,
   it is taken to represent the hard-wired default privileges for its object,
   <emphasis>not</emphasis> whatever might be in <structname>pg_default_acl</structname>
   at the moment.  <structname>pg_default_acl</structname> is only consulted during
   object creation.
  </para>

 </sect1>


 <sect1 id="catalog-pg-depend">
  <title><structname>pg_depend</structname></title>

  <indexterm zone="catalog-pg-depend">
   <primary>pg_depend</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_depend</structname> records the dependency
   relationships between database objects.  This information allows
   <command>DROP</command> commands to find which other objects must be dropped
   by <command>DROP CASCADE</command> or prevent dropping in the <command>DROP
   RESTRICT</command> case.
  </para>

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

  <table>
   <title><structname>pg_depend</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>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
      </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>refobjsubid</structfield> <type>int4</type>
      </para>
      <para>
       For a table column, this is the column number (the
       <structfield>refobjid</structfield> and <structfield>refclassid</structfield>

Title: pg_depend Catalog: Object Dependency Relationships
Summary
This section first concludes the discussion of the pg_default_acl catalog, reiterating the distinction between global and per-schema entries, and emphasizing that pg_default_acl is consulted only during object creation. It then introduces the pg_depend catalog, which tracks dependency relationships between database objects, enabling DROP CASCADE and DROP RESTRICT functionality. It also mentions pg_shdepend for dependencies across a database cluster. The description provides details on the pg_depend columns: classid, objid, objsubid, refclassid, refobjid, and refobjsubid.