PG_SHDEPEND

PG_SHDEPEND records the dependency relationships between database objects and shared objects, such as roles. This information allows GaussDB(DWS) to ensure that those objects are unreferenced before attempting to delete them.

See also PG_DEPEND, which performs a similar function for dependencies involving objects within a single database.

Unlike most system catalogs, PG_SHDEPEND is shared across all databases of a cluster: there is only one copy of PG_SHDEPEND per cluster, not one per database.

Table 1 PG_SHDEPEND columns

Name

Type

Reference

Description

dbid

oid

PG_DATABASE.oid

OID of the database the dependent object is in. The value is 0 for a shared object.

classid

oid

PG_CLASS.oid

OID of the system catalog the dependent object is in.

objid

oid

Any OID column

OID of the specific dependent object

objsubid

integer

-

For a table column, this is the column number (the objid and classid refer to the table itself). For all other object types, this column is 0.

refclassid

oid

PG_CLASS.oid

OID of the system catalog the referenced object is in (must be a shared catalog)

refobjid

oid

Any OID column

OID of the specific referenced object

deptype

"char"

-

Code segment defining the specific semantics of this dependency relationship. See the following text for details.

objfile

text

-

Path of the user-defined C function library file.

In all cases, a pg_shdepend entry indicates that the referenced object cannot be dropped without also dropping the dependent object. However, there are several subflavors defined by deptype: