forked from docs/doc-exports
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>
162 lines
16 KiB
HTML
162 lines
16 KiB
HTML
<a name="EN-US_TOPIC_0000001188642034"></a><a name="EN-US_TOPIC_0000001188642034"></a>
|
|
|
|
<h1 class="topictitle1">PG_LOCKS</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001188642034__en-us_topic_0059779012_p186404285537"><strong id="EN-US_TOPIC_0000001188642034__b1249423918360">PG_LOCKS</strong> displays information about the locks held by open transactions.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188642034__te10e5c92456a4b5ba6c02c714205f96b" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_LOCKS columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188642034__r02debbe1544442979e6fb249011ceff7"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001188642034__a320559050e18418a98b902e19d435f2f"><strong id="EN-US_TOPIC_0000001188642034__b84235270691445">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000001188642034__a1864cac105b440ad8901f602fc3465eb">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000001188642034__aa49fedcd71064f609fc1910c8928934f">Reference</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="45%" id="mcps1.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000001188642034__a88c6f41b17064d0c828af27994120741">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001188642034__r080b9dd715a842dea26ad164c899be94"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__af009738cfb06400d959beaf7ed445be8">locktype</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a459df28c115d4b9e94b3219d3edc5216">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a90f1bf0ec9af40fea34a66111bac9a94">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a89b83ab8ed8246f8ac7e1b0538546fe8">Type of the locked object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, and advisory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__rf28e8562bb0341cd89820bec08441172"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a8d2ca73c69014de1bd6ec80ab7bace78">database</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__aaa7d3f401256460ca3f2ca25e7c6d352">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__aa73560e049f2487394c8927fbed89e22"><a href="dws_04_0582.html">PG_DATABASE</a>.oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a7034b20e91bc440aaa081a41f6d6bddc">OID of the database in which the locked target exists</p>
|
|
<ul id="EN-US_TOPIC_0000001188642034__u578204bfb5654c3abf8196fff78a327b"><li id="EN-US_TOPIC_0000001188642034__lfe45fb6568964cb480aa7ff6e8b4fdc9">The OID is <strong id="EN-US_TOPIC_0000001188642034__b1583813101318">0</strong> if the target is a shared object.</li><li id="EN-US_TOPIC_0000001188642034__l7ad4048cc4114e79802667bf2f4b3261">The OID is <strong id="EN-US_TOPIC_0000001188642034__b954185083418">NULL</strong> if the locked target is a transaction.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__rd3ccd2c948bb4e93bc90e28c341a0e33"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a01513f03742041fc92ad116b1a6eb66e">relation</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a9fb9d85c0e7647edb199cbf431c035d1">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__af60b6046ef4b42d58c49979422c18352"><a href="dws_04_0578.html">PG_CLASS</a>.oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a7256db14cc1f4eed992b086a7bdf6549">OID of the relationship targeted by the lock. The value is <strong id="EN-US_TOPIC_0000001188642034__b12976816161611">NULL</strong> if the object is neither a relationship nor part of a relationship.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r5863209edc224445817011004ececf42"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a2d0fac953d77422a8eeff44e1cda0602">page</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a5b157beb86cb4b92a82f927e8d213f42">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a933525af964e473eaeedafc4ebd1ed48">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__ada57496b309049c7928f20719c85319f">Page number targeted by the lock within the relationship. If the object is neither a relation page nor row page, the value is <strong id="EN-US_TOPIC_0000001188642034__b359855425819">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r3b9e2a4b9773443585d77c318503da4b"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a23d2d7cc36bf4bd786f7cef80a08d048">tuple</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a322480133de34672bdb0175fa5d1e87e">smallint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a8f0e75ac06e34f8f9b918e239b55b898">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__ab26ec3810f47404aa0e1599af5adb236">Row number targeted by the lock within the page. If the object is not a row, the value is <strong id="EN-US_TOPIC_0000001188642034__b743872575719">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r4909e652bf5c47b8a18c4597e236ad86"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__ad630048ceb9b44af86624027b380d89c">virtualxid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a79ffe37ddb4a4864a618923b83cc7001">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a36fcdbb049f847008d460b229a9cab0a">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__ada72af36374e4ebbaa663150cee1d35b">Virtual ID of the transaction targeted by the lock. If the object is not a virtual transaction ID, the value is <strong id="EN-US_TOPIC_0000001188642034__b16625114572">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r734c126d4c31422bb1727e80b4b1b899"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a28a8b7027e8143628c990f4a9c9d7932">transactionid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a6ab49199348b4b7b85bce7c284ca341a">xid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a8f7412785e974336b7132bea20c3f420">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a321688be8a014e3fabdb496d569064f2">ID of the transaction targeted by the lock. If the object is not a transaction ID, the value is <strong id="EN-US_TOPIC_0000001188642034__b1392316524569">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r1ac6eb468470439faa32522f39e6a2fc"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a97256e352e204910a8edce7973668f43">classid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__af1c0d97428cf45d99cd043f485f329a7">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a5e85c225b63045e79a75af7c578fa309"><a href="dws_04_0578.html">PG_CLASS</a>.oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a38100aa820d344c6b2ad147839703c73">OID of the system table that contains the object. If the object is not a general database object, the value is <strong id="EN-US_TOPIC_0000001188642034__b1729423085819">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r0729ec9128ed4ae9bb75bc7cd90c1740"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a2ad2b83ba93248218bba87a06fd5f5e2">objid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a2dbf945fbdbf49b4ac656cb2dd524708">oid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a75b3d628c99e45c993a55b01164b5d99">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a2dc31835f5b548c9b0e7b5745951ed77">OID of the lock target within its system table. If the target is not a general database object, the value is <strong id="EN-US_TOPIC_0000001188642034__b1515515110585">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__rcbf3c7f7ffaa45ad879adefa91386870"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a529e4de85b9141bd9420e25eec103180">objsubid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__aae5376519e5d46c0bc899607a4f12a1f">smallint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a2c4b6bdf128c4a2f8b695a8b5f19f1c0">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a51f2b8299aab4d8dbd2abf44a19a5c17">Column number for a column in the table. The value is <strong id="EN-US_TOPIC_0000001188642034__b101911413316">0</strong> if the target is some other object type. If the object is not a general database object, the value is <strong id="EN-US_TOPIC_0000001188642034__b1739871013">NULL</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r47483bcaf0604c9a87e0ed310444ce3e"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__aa4023b4d7d9f49f3b19c4f704f81921d">virtualtransaction</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__afc3c755be56d4e3a9571fdcb0f67897a">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a82e267a9dc234defbb6f2b9d65c10b95">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a990ab195c6fc43edbbbe407100efe4a1">Virtual ID of the transaction holding or awaiting this lock</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r428b8c47ea2c4d15bcab8b2fd9c21428"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a211ade5607b7467cbd660fb87ca8430a">pid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__ae28c27c36f2e4002a1c55d930bf12a54">bigint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a1b092af1bb9b42d39ba9633cbdc3a635">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a1d798ed8be5d40aa8bc38896a007274a">Logical ID of the server thread holding or awaiting this lock. This is <strong id="EN-US_TOPIC_0000001188642034__b1911851195917">NULL</strong> if the lock is held by a prepared transaction.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r0a709463751e4e2689d29cc4ea7da99c"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__add658b44ec3e4aae9e0882ef728eda14">mode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__aaeb22d537e924c98a7f8347263e6aa74">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__a83fcae4e5bb64bd9b89ddef8b1ac3187">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__p256964781510">Lock mode held or desired by this thread For more information about lock modes, see "LOCK" in <em id="EN-US_TOPIC_0000001188642034__i1283652319382">GaussDB(DWS) SQL Syntax Reference</em>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__r288c7ab211b34d4fbcb29691564f61f9"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__aa3a9a7528beb4fa0af5540fa39a4cfff">granted</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__ab74a9a6bad4e4136bd3d6fc08db8a93e"><span id="EN-US_TOPIC_0000001188642034__text147982239364">boolean</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__afbfb7708c54e43c3bcf9ed238434a8bb">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><ul id="EN-US_TOPIC_0000001188642034__u957728521c1743a3be5ad759df25b187"><li id="EN-US_TOPIC_0000001188642034__l4c7bf2fe03f24c0a9b81fa7f67466d74">The value is <strong id="EN-US_TOPIC_0000001188642034__b744264414814">true</strong> if the lock is a held lock.</li><li id="EN-US_TOPIC_0000001188642034__l8b10b836ebc3418aba4442271b74e8de">The value is <strong id="EN-US_TOPIC_0000001188642034__b1444599810">false</strong> if the lock is an awaited lock.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001188642034__rd50bfae7668d474fa9f9974c97e7028b"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001188642034__a67d830625ec545779680c62d22127637">fastpath</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001188642034__a0c6268f7b6844e1db72659d4433393e2"><span id="EN-US_TOPIC_0000001188642034__text590492410368">boolean</span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001188642034__aabfb6bdd7937479992b0c72c366bc500">-</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001188642034__a254b1047faf940309ff1288f0c9cdce4">Whether the lock is obtained through <strong id="EN-US_TOPIC_0000001188642034__b376010291722">fast-path</strong> (<strong id="EN-US_TOPIC_0000001188642034__b1676511291325">true</strong>) or main lock table (<strong id="EN-US_TOPIC_0000001188642034__b117651229127">false</strong>)</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0639.html">System Views</a></div>
|
|
</div>
|
|
</div>
|
|
|