Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
51.48. pg_shdepend
Prev UpChapter 51. System CatalogsHome Next

51.48. pg_shdepend#

The catalogpg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allowsPostgreSQL to ensure that those objects are unreferenced before attempting to delete them.

See alsopg_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 ofpg_shdepend per cluster, not one per database.

Table 51.48. pg_shdepend Columns

Column Type

Description

dbidoid (referencespg_database.oid)

The OID of the database the dependent object is in, or zero for a shared object

classidoid (referencespg_class.oid)

The OID of the system catalog the dependent object is in

objidoid (references any OID column)

The OID of the specific dependent object

objsubidint4

For a table column, this is the column number (theobjid andclassid refer to the table itself). For all other object types, this column is zero.

refclassidoid (referencespg_class.oid)

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

refobjidoid (references any OID column)

The OID of the specific referenced object

deptypechar

A code defining the specific semantics of this dependency relationship; see text


In all cases, apg_shdepend entry indicates that the referenced object cannot be dropped without also dropping the dependent object. However, there are several subflavors identified bydeptype:

SHARED_DEPENDENCY_OWNER (o)

The referenced object (which must be a role) is the owner of the dependent object.

SHARED_DEPENDENCY_ACL (a)

The referenced object (which must be a role) is mentioned in the ACL (access control list, i.e., privileges list) of the dependent object. (ASHARED_DEPENDENCY_ACL entry is not made for the owner of the object, since the owner will have aSHARED_DEPENDENCY_OWNER entry anyway.)

SHARED_DEPENDENCY_INITACL (i)

The referenced object (which must be a role) is mentioned in apg_init_privs entry for the dependent object.

SHARED_DEPENDENCY_POLICY (r)

The referenced object (which must be a role) is mentioned as the target of a dependent policy object.

SHARED_DEPENDENCY_TABLESPACE (t)

The referenced object (which must be a tablespace) is mentioned as the tablespace for a relation that doesn't have storage.

Other dependency flavors might be needed in future. Note in particular that the current definition only supports roles and tablespaces as referenced objects.

As in thepg_depend catalog, most objects created duringinitdb are consideredpinned. No entries are made inpg_shdepend that would have a pinned object as either referenced or dependent object.


Prev Up Next
51.47. pg_sequence Home 51.49. pg_shdescription
pdfepub
Go to PostgreSQL 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp