从pg_locks中选择是否总能为自己返回结果?

时间:2018-01-27 18:42:46

标签: postgresql postgresql-9.4

SELECT relation::regclass, * FROM pg_locks ;

结果如下:

 relation |  locktype  | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid  |      mode       | granted | fastpath 
 ----------+------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+------+-----------------+---------+----------
 pg_locks | relation   |    16397 |    11187 |      |       |            |               |         |       |          | 76/111628          | 2652 | AccessShareLock | t       | t
      | virtualxid |          |          |      |       | 76/111628  |               |         |       |          | 76/111628          | 2652 | ExclusiveLock   | t       | t
 (2 rows)

我可以假设我对pg_locks的查询本身就是导致该结果中ExclusiveLock的原因吗?

0 个答案:

没有答案