Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
52.18. pg_depend
Prev UpChapter 52. System CatalogsHome Next

52.18. pg_depend

The catalogpg_depend records the dependency relationships between database objects. This information allowsDROP commands to find which other objects must be dropped byDROP CASCADE or prevent dropping in theDROP RESTRICT case.

See alsopg_shdepend, which performs a similar function for dependencies involving objects that are shared across a database cluster.

Table 52.18. pg_depend Columns

NameTypeReferencesDescription
classidoidpg_class.oidThe OID of the system catalog the dependent object is in
objidoidany OID columnThe 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.
refclassidoidpg_class.oidThe OID of the system catalog the referenced object is in
refobjidoidany OID columnThe OID of the specific referenced object
refobjsubidint4  For a table column, this is the column number (therefobjid andrefclassid refer to the table itself). For all other object types, this column is zero.
deptypechar  A code defining the specific semantics of this dependency relationship; see text

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

DEPENDENCY_NORMAL (n)

A normal relationship between separately-created objects. The dependent object can be dropped without affecting the referenced object. The referenced object can only be dropped by specifyingCASCADE, in which case the dependent object is dropped, too. Example: a table column has a normal dependency on its data type.

DEPENDENCY_AUTO (a)

The dependent object can be dropped separately from the referenced object, and should be automatically dropped (regardless ofRESTRICT orCASCADE mode) if the referenced object is dropped. Example: a named constraint on a table is made autodependent on the table, so that it will go away if the table is dropped.

DEPENDENCY_INTERNAL (i)

The dependent object was created as part of creation of the referenced object, and is really just a part of its internal implementation. ADROP of the dependent object will be disallowed outright (we'll tell the user to issue aDROP against the referenced object, instead). ADROP of the referenced object will be propagated through to drop the dependent object whetherCASCADE is specified or not. Example: a trigger that's created to enforce a foreign-key constraint is made internally dependent on the constraint'spg_constraint entry.

DEPENDENCY_INTERNAL_AUTO (I)

The dependent object was created as part of creation of the referenced object, and is really just a part of its internal implementation. ADROP of the dependent object will be disallowed outright (we'll tell the user to issue aDROP against the referenced object, instead). While a regular internal dependency will prevent the dependent object from being dropped while any such dependencies remain,DEPENDENCY_INTERNAL_AUTO will allow such a drop as long as the object can be found by following any of such dependencies. Example: an index on a partition is made internal-auto-dependent on both the partition itself as well as on the index on the parent partitioned table; so the partition index is dropped together with either the partition it indexes, or with the parent index it is attached to.

DEPENDENCY_EXTENSION (e)

The dependent object is a member of theextension that is the referenced object (seepg_extension). The dependent object can be dropped only viaDROP EXTENSION on the referenced object. Functionally this dependency type acts the same as an internal dependency, but it's kept separate for clarity and to simplifypg_dump.

DEPENDENCY_AUTO_EXTENSION (x)

The dependent object is not a member of the extension that is the referenced object (and so should not be ignored by pg_dump), but cannot function without it and should be dropped when the extension itself is. The dependent object may be dropped on its own as well.

DEPENDENCY_PIN (p)

There is no dependent object; this type of entry is a signal that the system itself depends on the referenced object, and so that object must never be deleted. Entries of this type are created only byinitdb. The columns for the dependent object contain zeroes.

Other dependency flavors might be needed in future.


Prev Up Next
52.17. pg_default_acl Home 52.19. pg_description
epubpdf
Go to PostgreSQL 11
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp