バージョンごとのドキュメント一覧

52.48. pg_shdepend #

The catalog <structname>pg_shdepend</structname> records the dependency relationships between database objects and shared objects, such as roles. This information allows <productname>PostgreSQL</productname> to ensure that those objects are unreferenced before attempting to delete them. pg_shdependカタログは、データベースオブジェクトとロールのような共有オブジェクト間のリレーション依存関係を保持します。 この情報はPostgreSQLが依存関係を削除しようとする前に、これらのオブジェクトを参照されないようにすることを保証することを許可します。

See also <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>, which performs a similar function for dependencies involving objects within a single database. pg_dependも参照してください。 pg_dependは単一のデータベース内のオブジェクトに関する依存関係について同じような機能を実行します。

Unlike most system catalogs, <structname>pg_shdepend</structname> is shared across all databases of a cluster: there is only one copy of <structname>pg_shdepend</structname> per cluster, not one per database. 多くのシステムカタログと異なりpg_shdependはクラスタの全てのデータベースに共有されています。 データベース毎ではなく、クラスタ毎にただ1つのpg_shdependのコピーがあります。

表52.48 pg_shdependの列

<title><structname>pg_shdepend</structname> Columns</title>

Column Type 列 型

Description 説明

dbid oid (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>) (参照先 pg_database.oid)

The OID of the database the dependent object is in, or zero for a shared object 依存オブジェクトが属するデータベースのOID。 共有オブジェクトの場合はゼロ

classid oid (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>) (参照先 pg_class.oid)

The OID of the system catalog the dependent object is in 依存するオブジェクトが存在するシステムカタログのOID

objid oid (references any OID column) (いずれかのOID列)

The OID of the specific dependent object 特定の依存するオブジェクトのOID

objsubid int4

For a table column, this is the column number (the <structfield>objid</structfield> and <structfield>classid</structfield> refer to the table itself). For all other object types, this column is zero. テーブル列の場合、これは列番号です(objidとclassidはテーブル自身を参照します)。 他のすべての種類のオブジェクトでは、この列はゼロになります。

refclassid oid (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>) (参照先 pg_class.oid)

The OID of the system catalog the referenced object is in (must be a shared catalog) 参照されるオブジェクトが入っているシステムカタログのOID(共有カタログである必要があります)

refobjid oid (references any OID column) (いずれかのOID列)

The OID of the specific referenced object 特定の参照されるオブジェクトのOID

deptype char

A code defining the specific semantics of this dependency relationship; see text この依存関係の特定のセマンティクスを定義するコード(後述)


In all cases, a <structname>pg_shdepend</structname> entry indicates that the referenced object cannot be dropped without also dropping the dependent object. However, there are several subflavors identified by <structfield>deptype</structfield>: すべての場合において、pg_shdepend項目は依存するオブジェクトも削除しない限り、参照されるオブジェクトを削除できないことを示します。 もっとも、deptypeによって指定される以下のようないくつかのオプションもあります。

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 <acronym>ACL</acronym> of the dependent object. (A <symbol>SHARED_DEPENDENCY_ACL</symbol> entry is not made for the owner of the object, since the owner will have a <symbol>SHARED_DEPENDENCY_OWNER</symbol> entry anyway.) 参照されたオブジェクト(ロールである必要があります)が、依存するオブジェクトのACL内で述べられています。 (所有者はSHARED_DEPENDENCY_OWNER項目を持つため、SHARED_DEPENDENCY_ACL項目は、オブジェクトの所有者に対して作成されません。)

SHARED_DEPENDENCY_INITACL (i)

The referenced object (which must be a role) is mentioned in a <link linkend="catalog-pg-init-privs"><structname>pg_init_privs</structname></link> entry for the dependent object. 参照されたオブジェクト(ロールである必要があります)は、依存オブジェクトのpg_init_privsエントリで述べられています。

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 the <structname>pg_depend</structname> catalog, most objects created during <application>initdb</application> are considered <quote>pinned</quote>. No entries are made in <structname>pg_shdepend</structname> that would have a pinned object as either referenced or dependent object. pg_dependカタログと同様に、initdb時に作成されるほとんどのオブジェクトは「固定(pinned)」と見なされます。 pg_shdependには、参照オブジェクトまたは依存オブジェクトとして固定されたオブジェクトを持つエントリは作成されません。