pg_depend system catalog table 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. See also pg_shdepend, which performs a similar function for dependencies involving objects that are shared across a Greenplum system.
In all cases, a
pg_depend entry indicates that the referenced object may not be dropped without also dropping the dependent object. However, there are several subflavors identified by
CASCADE, in which case the dependent object is dropped, too. Example: a table column has a normal dependency on its data type.
CASCADEmode) if the referenced object is dropped. Example: a named constraint on a table is made autodependent on the table, so that it will go away if the table is dropped.
DROPof the dependent object will be disallowed outright (we’ll tell the user to issue a
DROPagainst the referenced object, instead). A
DROPof the referenced object will be propagated through to drop the dependent object whether
CASCADEis specified or not.
DEPENDENCY_PIN (p) — There is no dependent object; this type of entry is a signal that the system itself depends on the referenced object, and so that object must never be deleted. Entries of this type are created only by system initialization. The columns for the dependent object contain zeroes.
||oid||pg_class.oid||The OID of the system catalog the dependent object is in.|
||oid||any OID column||The OID of the specific dependent object.|
||int4||For a table column, this is the column number. For all other object types, this column is zero.|
||oid||pg_class.oid||The OID of the system catalog the referenced object is in.|
||oid||any OID column||The OID of the specific referenced object.|
||int4||For a table column, this is the referenced column number. For all other object types, this column is zero.|
||char||A code defining the specific semantics of this dependency relationship.|
Parent topic: System Catalogs Definitions