doc-exports/docs/dws/dev/dws_04_0616.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

105 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001233883199"></a><a name="EN-US_TOPIC_0000001233883199"></a>
<h1 class="topictitle1">PG_SHDEPEND</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001233883199__en-us_topic_0059778501_p0393343314"><strong id="EN-US_TOPIC_0000001233883199__b1169741119584">PG_SHDEPEND</strong> records the dependency relationships between database objects and shared objects, such as roles. This information allows <span id="EN-US_TOPIC_0000001233883199__text1096984736">GaussDB(DWS)</span> to ensure that those objects are unreferenced before they are deleted.</p>
<p id="EN-US_TOPIC_0000001233883199__af6e1fff7d93148b590e31c5067e5dfee">See also <a href="dws_04_0585.html">PG_DEPEND</a>, which performs a similar function for dependencies involving objects within a single database.</p>
<p id="EN-US_TOPIC_0000001233883199__a640b989dbe1a40d889e76a56fdd3bce3">Unlike most system catalogs, <strong id="EN-US_TOPIC_0000001233883199__b842352706105825">PG_SHDEPEND</strong> is shared across all databases of a cluster: there is only one copy of <strong id="EN-US_TOPIC_0000001233883199__b842352706105842">PG_SHDEPEND</strong> per cluster, not one per database.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001233883199__t5e8e01b7fd6f4be980f275de460b0817" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_SHDEPEND columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001233883199__r0f59e56b1ba64059ad72bb3e3ce80340"><th align="left" class="cellrowborder" valign="top" width="15.229999999999999%" id="mcps1.3.4.2.5.1.1"><p id="EN-US_TOPIC_0000001233883199__aa46d920d2b164c5cacbc5edba33285ed">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.590000000000002%" id="mcps1.3.4.2.5.1.2"><p id="EN-US_TOPIC_0000001233883199__adcdc485be9ae44f2b800110398c6ffb7">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="27.439999999999998%" id="mcps1.3.4.2.5.1.3"><p id="EN-US_TOPIC_0000001233883199__a3eccab6b46834cc18d649f795fead9bb">Reference</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.74%" id="mcps1.3.4.2.5.1.4"><p id="EN-US_TOPIC_0000001233883199__a45fd4028931342df97df7bff20f7b95e">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001233883199__r277365e35cd44e4d85363f255c69bf30"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__a3596c37ea7d14d469faf650101aecd26">dbid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__a7f4b714a5e9e4450a581d7483ecdbf29">oid</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a4ab54342c1ac4c80887f764e32c1c18f"><a href="dws_04_0582.html">PG_DATABASE</a>.oid</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__aafee04499a8048e1a71716d13832e848">OID of the database the dependent object is in. The value is <strong id="EN-US_TOPIC_0000001233883199__b2085731933312">0</strong> for a shared object.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__ref87126a61154ee7ad66e71254fcce02"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__a049c7aa644784a80a76de728fcf343b8">classid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__a330e6f99c3d54861b35aa76b95158f1c">oid</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a6616169341504644ba344c9b3b2dd9a5"><a href="dws_04_0578.html">PG_CLASS</a>.oid</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__a4cc206fddeec45c09fbb516e9d9a8fdb">OID of the system catalog the dependent object is in.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__r4e210a6a3d94424c978710877d5d58b0"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__a76fac07210c74cd4bd73cee8c4ede407">objid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__aa7fd98705bcf4d2aae9de1c3747faef5">oid</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__ad1bf3048e2d543949cc65c1c7b747e8f">Any OID column</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__a0b334e61141546698ac0f0fa481b7f68">OID of the specific dependent object</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__rdfb8165036b94a3ab6209b11433fc50e"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__aacc27850849c49c29ddaf70971fd8293">objsubid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__ac4ad8f5914c94e88b29f5bc7e5a7521f">integer</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a73e0898914814e488a17e80f8751c12c">-</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__aae90b2e043ef456292e57b4580fc1d5e">For a table column, this is the column number (the <strong id="EN-US_TOPIC_0000001233883199__b84235270611186">objid</strong> and <strong id="EN-US_TOPIC_0000001233883199__b842352706111810">classid</strong> refer to the table itself). For all other object types, this column is <strong id="EN-US_TOPIC_0000001233883199__b1152655117334">0</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__r72a5763506884bf18be5f69f7592316b"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__ae27967c598404d2eba5e994dd0a3f7e2">refclassid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__ab5807854a50d43fb99e43fce46c5e36c">oid</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a36297d081e5040eb9e1b2ba37ee2d23a"><a href="dws_04_0578.html">PG_CLASS</a>.oid</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__a5c0413d7ede546728508cde8c8f98f42">OID of the system catalog the referenced object is in (must be a shared catalog)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__r97c35450e77f4dfd9e7b50e50e5a1bf8"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__a073e7ac0b9e840f1b025c5134e1e7b19">refobjid</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__ab488d69e4d0c4450b7e06377ab1fe8d2">oid</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a4dac0f1d7a644019a381d0b27d09690f">Any OID column</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__a64196bc3ede14320960157206821c982">OID of the specific referenced object</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__r1b3527dc13e3462a815a968809aa7b4b"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__aad2ce5afa5304a3b90750e853041ca1d">deptype</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__ab27d1dd001aa4754a5e8986c75bac16b">"char"</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__a0f3feabf85344a3da9ff58b1a695e7ea">-</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__a842de19ed3df4c5e8bc0fd3a183a6215">Code segment defining the specific semantics of this dependency relationship. See the following text for details.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001233883199__row49453021144559"><td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001233883199__p46271755144559">objfile</p>
</td>
<td class="cellrowborder" valign="top" width="12.590000000000002%" headers="mcps1.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001233883199__p57024678144559">text</p>
</td>
<td class="cellrowborder" valign="top" width="27.439999999999998%" headers="mcps1.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001233883199__p55596181144559">-</p>
</td>
<td class="cellrowborder" valign="top" width="44.74%" headers="mcps1.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001233883199__p6996801144559">Path of the user-defined C function library file.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001233883199__a93892ffcdc9f448da0bfa3afd36ac7a4">In all cases, a <strong id="EN-US_TOPIC_0000001233883199__b842352706112155">pg_shdepend</strong> entry indicates that the referenced object cannot be dropped without also dropping the dependent object. However, there are several subflavors defined by <strong id="EN-US_TOPIC_0000001233883199__b152313710385">deptype</strong>:</p>
<ul id="EN-US_TOPIC_0000001233883199__ub79de75c54dc4e8ebdb13ff8a9bea5d8"><li id="EN-US_TOPIC_0000001233883199__lf916987ec22542288a495ab7b2dd9c3b">SHARED_DEPENDENCY_OWNER (o)<p id="EN-US_TOPIC_0000001233883199__aa4b257ebf04744bca67efbe0a29a5f20"><a name="EN-US_TOPIC_0000001233883199__lf916987ec22542288a495ab7b2dd9c3b"></a><a name="lf916987ec22542288a495ab7b2dd9c3b"></a>The referenced object (which must be a role) is the owner of the dependent object.</p>
</li><li id="EN-US_TOPIC_0000001233883199__l1565a2868d8c4a5981f58611f21819ad">SHARED_DEPENDENCY_ACL (a)<p id="EN-US_TOPIC_0000001233883199__a5abb6271e9eb4ec49c44e292bbd79140"><a name="EN-US_TOPIC_0000001233883199__l1565a2868d8c4a5981f58611f21819ad"></a><a name="l1565a2868d8c4a5981f58611f21819ad"></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. (A <strong id="EN-US_TOPIC_0000001233883199__b6901195115406">SHARED_DEPENDENCY_ACL</strong> entry is not made for the owner of the object, since the owner will have a <strong id="EN-US_TOPIC_0000001233883199__b34542056414">SHARED_DEPENDENCY_OWNER</strong> entry anyway.)</p>
</li><li id="EN-US_TOPIC_0000001233883199__l6872b712ca4641ee920d12c0926bbd72">SHARED_DEPENDENCY_PIN (p)<p id="EN-US_TOPIC_0000001233883199__acbd11647b89f407e826676fb0313d8f4"><a name="EN-US_TOPIC_0000001233883199__l6872b712ca4641ee920d12c0926bbd72"></a><a name="l6872b712ca4641ee920d12c0926bbd72"></a>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 by <strong id="EN-US_TOPIC_0000001233883199__b18841857104112">initdb</strong>. The columns for the dependent object contain zeroes.</p>
</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0561.html">System Catalogs</a></div>
</div>
</div>