↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

pg_shdepend

The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL 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.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

kind
catalog
lang
en
measured attributes
true
metadata release
18.6
runtime columns
dbid, classid, objid, objsubid, refclassid, refobjid, deptype
runtime verified
false
source
english-manual

Definition PG 18

The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL 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.

Catalog columns

ColumnTypeNullabilityDescription
dbidoidNot nullThe OID of the database the dependent object is in, or zero for a shared object
classidoidNot nullThe OID of the system catalog the dependent object is in
objidoidNot nullThe OID of the specific dependent object
objsubidint4Not nullFor 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 zero.
refclassidoidNot nullThe OID of the system catalog the referenced object is in (must be a shared catalog)
refobjidoidNot nullThe OID of the specific referenced object
deptypecharNot nullA code defining the specific semantics of this dependency relationship; see text

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · catalog-bilingual-repair:115fe90189259b1042415f11503b5f5d55ea5e96625ebe2f19e01e0c05f9b9dd

Text language: en · catalog-bilingual-repair:115fe90189259b1042415f11503b5f5d55ea5e96625ebe2f19e01e0c05f9b9dd