pg_depend — PostgreSQL system catalog

The PostgreSQL pg_depend system catalog: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

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

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_depend system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • classid oid references pg_class.oid
    The OID of the system catalog the dependent object is in
  • objid oid references any OID column
    The OID of the specific dependent object
  • objsubid int4
    For a table column, this is the column number (the objid and classid refer to the table itself). For all other object types, this column is zero.
  • refclassid oid references pg_class.oid
    The OID of the system catalog the referenced object is in
  • refobjid oid references any OID column
    The OID of the specific referenced object
  • refobjsubid int4
    For a table column, this is the column number (the refobjid and refclassid refer to the table itself). For all other object types, this column is zero.
  • deptype char
    A code defining the specific semantics of this dependency relationship; see text

Related catalogs

This object references the following other system catalogs:

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_depend.