4 The catalog pg_shdepend records the dependency relationships between
5 database objects and shared objects, such as roles. This information
6 allows PostgreSQL to ensure that those objects are unreferenced before
7 attempting to delete them.
9 See also pg_depend, which performs a similar function for dependencies
10 involving objects within a single database.
12 Unlike most system catalogs, pg_shdepend is shared across all databases
13 of a cluster: there is only one copy of pg_shdepend per cluster, not
16 Table 52.48. pg_shdepend Columns
22 dbid oid (references pg_database.oid)
24 The OID of the database the dependent object is in, or zero for a
27 classid oid (references pg_class.oid)
29 The OID of the system catalog the dependent object is in
31 objid oid (references any OID column)
33 The OID of the specific dependent object
37 For a table column, this is the column number (the objid and classid
38 refer to the table itself). For all other object types, this column is
41 refclassid oid (references pg_class.oid)
43 The OID of the system catalog the referenced object is in (must be a
46 refobjid oid (references any OID column)
48 The OID of the specific referenced object
52 A code defining the specific semantics of this dependency relationship;
55 In all cases, a pg_shdepend entry indicates that the referenced object
56 cannot be dropped without also dropping the dependent object. However,
57 there are several subflavors identified by deptype:
59 SHARED_DEPENDENCY_OWNER (o)
60 The referenced object (which must be a role) is the owner of the
63 SHARED_DEPENDENCY_ACL (a)
64 The referenced object (which must be a role) is mentioned in the
65 ACL of the dependent object. (A SHARED_DEPENDENCY_ACL entry is
66 not made for the owner of the object, since the owner will have
67 a SHARED_DEPENDENCY_OWNER entry anyway.)
69 SHARED_DEPENDENCY_INITACL (i)
70 The referenced object (which must be a role) is mentioned in a
71 pg_init_privs entry for the dependent object.
73 SHARED_DEPENDENCY_POLICY (r)
74 The referenced object (which must be a role) is mentioned as the
75 target of a dependent policy object.
77 SHARED_DEPENDENCY_TABLESPACE (t)
78 The referenced object (which must be a tablespace) is mentioned
79 as the tablespace for a relation that doesn't have storage.
81 Other dependency flavors might be needed in future. Note in particular
82 that the current definition only supports roles and tablespaces as
85 As in the pg_depend catalog, most objects created during initdb are
86 considered “pinned”. No entries are made in pg_shdepend that would have
87 a pinned object as either referenced or dependent object.