pg_depend

A system catalogue table recording dependencies between database objects

pg_depend is a system catalogue table recording dependencies between database objects, to ensure dropping one object leads to dependent objects being dropped, or the drop operation being blocked, depending on how the relationship between objects is defined.

pg_depend was added in PostgreSQL 7.3 together with pg_constraint, replacing pg_relcheck (commit 7c6df91d).

Duplicate entries

It's possible that pg_depend contains duplicate entries. This is not considered a bug; see e.g. this pgsql-hackers thread.

Definition by PostgreSQL version

pg_depend (PostgreSQL 13)

              Table "pg_catalog.pg_depend"
   Column    |  Type   | Collation | Nullable | Default
-------------+---------+-----------+----------+---------
 classid     | oid     |           | not null |
 objid       | oid     |           | not null |
 objsubid    | integer |           | not null |
 refclassid  | oid     |           | not null |
 refobjid    | oid     |           | not null |
 refobjsubid | integer |           | not null |
 deptype     | "char"  |           | not null |
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 12)

              Table "pg_catalog.pg_depend"
   Column    |  Type   | Collation | Nullable | Default
-------------+---------+-----------+----------+---------
 classid     | oid     |           | not null |
 objid       | oid     |           | not null |
 objsubid    | integer |           | not null |
 refclassid  | oid     |           | not null |
 refobjid    | oid     |           | not null |
 refobjsubid | integer |           | not null |
 deptype     | "char"  |           | not null |
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 11)

              Table "pg_catalog.pg_depend"
   Column    |  Type   | Collation | Nullable | Default
-------------+---------+-----------+----------+---------
 classid     | oid     |           | not null |
 objid       | oid     |           | not null |
 objsubid    | integer |           | not null |
 refclassid  | oid     |           | not null |
 refobjid    | oid     |           | not null |
 refobjsubid | integer |           | not null |
 deptype     | "char"  |           | not null |
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 10)

              Table "pg_catalog.pg_depend"
   Column    |  Type   | Collation | Nullable | Default
-------------+---------+-----------+----------+---------
 classid     | oid     |           | not null |
 objid       | oid     |           | not null |
 objsubid    | integer |           | not null |
 refclassid  | oid     |           | not null |
 refobjid    | oid     |           | not null |
 refobjsubid | integer |           | not null |
 deptype     | "char"  |           | not null |
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.6)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.5)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.4)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.3)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.2)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.1)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 9.0)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 8.4)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 8.3)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

pg_depend (PostgreSQL 8.2)

   Table "pg_catalog.pg_depend"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 classid     | oid     | not null
 objid       | oid     | not null
 objsubid    | integer | not null
 refclassid  | oid     | not null
 refobjid    | oid     | not null
 refobjsubid | integer | not null
 deptype     | "char"  | not null
Indexes:
    "pg_depend_depender_index" btree (classid, objid, objsubid)
    "pg_depend_reference_index" btree (refclassid, refobjid, refobjsubid)
    

Documentation: pg_depend

Categories

DDL, System catalogue

See also

pg_shdepend