]> begriffs open source - ai-pg/blob - full-docs/txt/catalog-pg-shdepend.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / catalog-pg-shdepend.txt
1
2 52.48. pg_shdepend #
3
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.
8
9    See also pg_depend, which performs a similar function for dependencies
10    involving objects within a single database.
11
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
14    one per database.
15
16    Table 52.48. pg_shdepend Columns
17
18    Column Type
19
20    Description
21
22    dbid oid (references pg_database.oid)
23
24    The OID of the database the dependent object is in, or zero for a
25    shared object
26
27    classid oid (references pg_class.oid)
28
29    The OID of the system catalog the dependent object is in
30
31    objid oid (references any OID column)
32
33    The OID of the specific dependent object
34
35    objsubid int4
36
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
39    zero.
40
41    refclassid oid (references pg_class.oid)
42
43    The OID of the system catalog the referenced object is in (must be a
44    shared catalog)
45
46    refobjid oid (references any OID column)
47
48    The OID of the specific referenced object
49
50    deptype char
51
52    A code defining the specific semantics of this dependency relationship;
53    see text
54
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:
58
59    SHARED_DEPENDENCY_OWNER (o)
60           The referenced object (which must be a role) is the owner of the
61           dependent object.
62
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.)
68
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.
72
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.
76
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.
80
81    Other dependency flavors might be needed in future. Note in particular
82    that the current definition only supports roles and tablespaces as
83    referenced objects.
84
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.