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):
classidoidreferencespg_class.oid
The OID of the system catalog the dependent object is inobjidoidreferencesany OID column
The OID of the specific dependent objectobjsubidint4
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.refclassidoidreferencespg_class.oid
The OID of the system catalog the referenced object is inrefobjidoidreferencesany OID column
The OID of the specific referenced objectrefobjsubidint4
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.deptypechar
A code defining the specific semantics of this dependency relationship; see text
Related catalogs
This object references the following other system catalogs:
classid→pg_class
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.