Files
doc-exports/docs/dws/dev/dws_04_0737.html
luhuayi 177cd61a57 DWS DEVG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-05-05 07:44:03 +00:00

181 lines
18 KiB
HTML

<a name="EN-US_TOPIC_0000001764491584"></a><a name="EN-US_TOPIC_0000001764491584"></a>
<h1 class="topictitle1">PG_LOCKS</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001764491584__en-us_topic_0059779012_p186404285537"><strong id="EN-US_TOPIC_0000001764491584__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_0000001764491584__te10e5c92456a4b5ba6c02c714205f96b" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PG_LOCKS columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001764491584__r02debbe1544442979e6fb249011ceff7"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000001764491584__a320559050e18418a98b902e19d435f2f"><strong id="EN-US_TOPIC_0000001764491584__b46671915243652">Column</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_0000001764491584__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_0000001764491584__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_0000001764491584__a88c6f41b17064d0c828af27994120741">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001764491584__r080b9dd715a842dea26ad164c899be94"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__af009738cfb06400d959beaf7ed445be8">locktype</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a459df28c115d4b9e94b3219d3edc5216">Text</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a90f1bf0ec9af40fea34a66111bac9a94">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__a89b83ab8ed8246f8ac7e1b0538546fe8">Type of the locked object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, and advisory</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__rf28e8562bb0341cd89820bec08441172"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a8d2ca73c69014de1bd6ec80ab7bace78">database</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__aaa7d3f401256460ca3f2ca25e7c6d352">OID</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__a7034b20e91bc440aaa081a41f6d6bddc">OID of the database in which the locked target exists</p>
<ul id="EN-US_TOPIC_0000001764491584__u578204bfb5654c3abf8196fff78a327b"><li id="EN-US_TOPIC_0000001764491584__lfe45fb6568964cb480aa7ff6e8b4fdc9">The OID is <strong id="EN-US_TOPIC_0000001764491584__b1583813101318">0</strong> if the target is a shared object.</li><li id="EN-US_TOPIC_0000001764491584__l7ad4048cc4114e79802667bf2f4b3261">The OID is <strong id="EN-US_TOPIC_0000001764491584__b954185083418">NULL</strong> if the locked target is a transaction.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__rd3ccd2c948bb4e93bc90e28c341a0e33"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a01513f03742041fc92ad116b1a6eb66e">relation</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a9fb9d85c0e7647edb199cbf431c035d1">OID</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__a7256db14cc1f4eed992b086a7bdf6549">OID of the relationship targeted by the lock. The value is <strong id="EN-US_TOPIC_0000001764491584__b12976816161611">NULL</strong> if the object is neither a relationship nor part of a relationship.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r5863209edc224445817011004ececf42"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a2d0fac953d77422a8eeff44e1cda0602">page</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a5b157beb86cb4b92a82f927e8d213f42">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a933525af964e473eaeedafc4ebd1ed48">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b359855425819">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r3b9e2a4b9773443585d77c318503da4b"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a23d2d7cc36bf4bd786f7cef80a08d048">tuple</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a322480133de34672bdb0175fa5d1e87e">Smallint</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a8f0e75ac06e34f8f9b918e239b55b898">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b743872575719">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r4909e652bf5c47b8a18c4597e236ad86"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__ad630048ceb9b44af86624027b380d89c">virtualxid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a79ffe37ddb4a4864a618923b83cc7001">Text</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a36fcdbb049f847008d460b229a9cab0a">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b16625114572">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r734c126d4c31422bb1727e80b4b1b899"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a28a8b7027e8143628c990f4a9c9d7932">transactionid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a6ab49199348b4b7b85bce7c284ca341a">Xid</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a8f7412785e974336b7132bea20c3f420">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b1392316524569">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r1ac6eb468470439faa32522f39e6a2fc"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a97256e352e204910a8edce7973668f43">classid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__af1c0d97428cf45d99cd043f485f329a7">OID</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__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_0000001764491584__b1729423085819">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r0729ec9128ed4ae9bb75bc7cd90c1740"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a2ad2b83ba93248218bba87a06fd5f5e2">objid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a2dbf945fbdbf49b4ac656cb2dd524708">OID</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a75b3d628c99e45c993a55b01164b5d99">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b1515515110585">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__rcbf3c7f7ffaa45ad879adefa91386870"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a529e4de85b9141bd9420e25eec103180">objsubid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__aae5376519e5d46c0bc899607a4f12a1f">Smallint</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a2c4b6bdf128c4a2f8b695a8b5f19f1c0">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__a51f2b8299aab4d8dbd2abf44a19a5c17">Column number for a column in the table. The value is <strong id="EN-US_TOPIC_0000001764491584__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_0000001764491584__b1739871013">NULL</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r47483bcaf0604c9a87e0ed310444ce3e"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__aa4023b4d7d9f49f3b19c4f704f81921d">virtualtransaction</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__afc3c755be56d4e3a9571fdcb0f67897a">Text</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a82e267a9dc234defbb6f2b9d65c10b95">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__a990ab195c6fc43edbbbe407100efe4a1">Virtual ID of the transaction holding or awaiting this lock</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r428b8c47ea2c4d15bcab8b2fd9c21428"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a211ade5607b7467cbd660fb87ca8430a">pid</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__ae28c27c36f2e4002a1c55d930bf12a54">Bigint</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a1b092af1bb9b42d39ba9633cbdc3a635">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__a1d798ed8be5d40aa8bc38896a007274a">Logical ID of the server thread holding or awaiting this lock. This is <strong id="EN-US_TOPIC_0000001764491584__b1911851195917">NULL</strong> if the lock is held by a prepared transaction.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r0a709463751e4e2689d29cc4ea7da99c"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__add658b44ec3e4aae9e0882ef728eda14">mode</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__aaeb22d537e924c98a7f8347263e6aa74">Text</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__a83fcae4e5bb64bd9b89ddef8b1ac3187">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__p256964781510">Lock mode held or desired by this thread For more information about lock modes, see "LOCK" in the <em id="EN-US_TOPIC_0000001764491584__i1132794014292">Data Warehouse Service (DWS) SQL Syntax Reference</em>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__r288c7ab211b34d4fbcb29691564f61f9"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__aa3a9a7528beb4fa0af5540fa39a4cfff">granted</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__ab74a9a6bad4e4136bd3d6fc08db8a93e"><span id="EN-US_TOPIC_0000001764491584__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_0000001764491584__afbfb7708c54e43c3bcf9ed238434a8bb">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><ul id="EN-US_TOPIC_0000001764491584__u957728521c1743a3be5ad759df25b187"><li id="EN-US_TOPIC_0000001764491584__l4c7bf2fe03f24c0a9b81fa7f67466d74">The value is <strong id="EN-US_TOPIC_0000001764491584__b744264414814">true</strong> if the lock is a held lock.</li><li id="EN-US_TOPIC_0000001764491584__l8b10b836ebc3418aba4442271b74e8de">The value is <strong id="EN-US_TOPIC_0000001764491584__b1444599810">false</strong> if the lock is an awaited lock.</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__rd50bfae7668d474fa9f9974c97e7028b"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__a67d830625ec545779680c62d22127637">fastpath</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__a0c6268f7b6844e1db72659d4433393e2"><span id="EN-US_TOPIC_0000001764491584__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_0000001764491584__aabfb6bdd7937479992b0c72c366bc500">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__a254b1047faf940309ff1288f0c9cdce4">Whether the lock is obtained through <strong id="EN-US_TOPIC_0000001764491584__b376010291722">fast-path</strong> (<strong id="EN-US_TOPIC_0000001764491584__b1676511291325">true</strong>) or main lock table (<strong id="EN-US_TOPIC_0000001764491584__b117651229127">false</strong>)</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__row111018199117"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__p381818173118">waittime</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__p9331193817113">Timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__p2818171719114">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__p209461043723">Timestamp when the lock wait starts.</p>
<p id="EN-US_TOPIC_0000001764491584__p34081254232">This column is available only in clusters of version 9.1.0.200 or later.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001764491584__row396191810"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001764491584__p3818161712120">holdtime</p>
</td>
<td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001764491584__p1319012251222">Timestamp with time zone</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001764491584__p188181117619">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="45%" headers="mcps1.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001764491584__p11256559921">Timestamp when the lock starts to be held. This column is available only in clusters of version 9.1.0.200 or later.</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>