pg_depend

The pg_depend catalog provides information about dependency relationships between objects.

Column name Data type Description
classid oid (references pg_class.oid) The OID of the system catalog containing a dependent object.
objid oid (references any OID column) The OID of the specific dependent object.
objsubid int4 The column number of the table.
0 – For other object types.
refclassid oid (references pg_class.oid) The OID of the system catalog containing the referenced object.
refobjid oid (references any OID column) The OID of the specific referenced object.
refobjsubid int4 The column number of the table column.
0 – For other object types.
deptype char A code defining the specific semantics of this dependency relationship.
The possible options are:
  • n – DEPENDENCY_NORMAL – A dependent object cannot exist without the referenced object.
  • a – DEPENDENCY_AUTO – A dependent object is automatically created and dropped with the referenced object.
  • i – DEPENDENCY_INTERNAL – A dependent object is an internal part of the referenced object.
  • p – DEPENDENCY_PIN – An object is pinned in the system catalogs and cannot be dropped.