{"Entry":{"collection":"catalog","key":"pg_locks","name":"pg_locks","aliases":[],"metadata":{"changed_in":["8.1","8.3","9.2","14"],"changes":[{"added":["locktype","page","tuple","transactionid","classid","objid","objsubid"],"attributes":[],"description_changed":true,"descriptions":[{"from":"OID of the database in which the locked relation exists, or zero if the locked relation is a globally-shared table, or NULL if the lockable object is a transaction ID","name":"database","to":"OID of the database in which the object exists, or zero if the object is a shared object, or NULL if the object is a transaction ID"},{"from":"process ID of a server process holding or awaiting this lock","name":"pid","to":"Process ID of the server process holding or awaiting this lock. Null if the lock is held by a prepared transaction."},{"from":"OID of the locked relation, or NULL if the lockable object is a transaction ID","name":"relation","to":"OID of the relation, or NULL if the object is not a relation or part of a relation"},{"from":"ID of a transaction, or NULL if the lockable object is a relation","name":"transaction","to":"ID of the transaction that is holding or awaiting this lock."}],"from":"8.0","listing":[],"order":true,"removed":[],"status":"changed","to":"8.1","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"true if lock is held, false if lock is awaited","name":"granted","to":"True if lock is held, false if lock is awaited"},{"from":"type of the lockable object: relation, extend, page, tuple, transactionid, object, or userlock","name":"locktype","to":"type of the lockable object: relation, extend, page, tuple, transactionid, object, userlock, or advisory"},{"from":"name of the lock mode held or desired by this process (see Section 12.3.1)","name":"mode","to":"Name of the lock mode held or desired by this process (see Section 12.3.1)"},{"from":"page number within the relation, or NULL if the object is not a tuple or relation page","name":"page","to":"Page number within the relation, or NULL if the object is not a tuple or relation page"},{"from":"Process ID of the server process holding or awaiting this lock. Null if the lock is held by a prepared transaction.","name":"pid","to":"Process ID of the server process holding or awaiting this lock. NULL if the lock is held by a prepared transaction"},{"from":"ID of the transaction that is holding or awaiting this lock.","name":"transaction","to":"ID of the transaction that is holding or awaiting this lock"},{"from":"tuple number within the page, or NULL if the object is not a tuple","name":"tuple","to":"Tuple number within the page, or NULL if the object is not a tuple"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.2","types":[],"unlisted":[]},{"added":["virtualxid","virtualtransaction"],"attributes":[],"description_changed":true,"descriptions":[{"from":"type of the lockable object: relation, extend, page, tuple, transactionid, object, userlock, or advisory","name":"locktype","to":"type of the lockable object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, or advisory"},{"from":"Name of the lock mode held or desired by this process (see Section 12.3.1)","name":"mode","to":"Name of the lock mode held or desired by this process (see Section 13.3.1)"}],"from":"8.2","listing":[],"order":false,"removed":["transaction"],"status":"changed","to":"8.3","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"OID of the system catalog containing the object, or NULL if the object is not a general database object","name":"classid","to":"OID of the system catalog containing the object, or null if the object is not a general database object"},{"from":"OID of the database in which the object exists, or zero if the object is a shared object, or NULL if the object is a transaction ID","name":"database","to":"OID of the database in which the object exists, or zero if the object is a shared object, or null if the object is a transaction ID"},{"from":"type of the lockable object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, or advisory","name":"locktype","to":"Type of the lockable object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, or advisory"},{"from":"OID of the object within its system catalog, or NULL if the object is not a general database object","name":"objid","to":"OID of the object within its system catalog, or null if the object is not a general database object"},{"from":"For a table column, this is the column number (the classid and objid refer to the table itself). For all other object types, this column is zero. NULL if the object is not a general database object","name":"objsubid","to":"For a table column, this is the column number (the classid and objid refer to the table itself). For all other object types, this column is zero. Null if the object is not a general database object"},{"from":"Page number within the relation, or NULL if the object is not a tuple or relation page","name":"page","to":"Page number within the relation, or null if the object is not a tuple or relation page"},{"from":"Process ID of the server process holding or awaiting this lock. NULL if the lock is held by a prepared transaction","name":"pid","to":"Process ID of the server process holding or awaiting this lock. Null if the lock is held by a prepared transaction."},{"from":"OID of the relation, or NULL if the object is not a relation or part of a relation","name":"relation","to":"OID of the relation, or null if the object is not a relation or part of a relation"},{"from":"ID of a transaction, or NULL if the object is not a transaction ID","name":"transactionid","to":"ID of a transaction, or null if the object is not a transaction ID"},{"from":"Tuple number within the page, or NULL if the object is not a tuple","name":"tuple","to":"Tuple number within the page, or null if the object is not a tuple"},{"from":"Virtual ID of a transaction, or NULL if the object is not a virtual transaction ID","name":"virtualxid","to":"Virtual ID of a transaction, or null if the object is not a virtual transaction ID"}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.0","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"Name of the lock mode held or desired by this process (see Section 13.3.1)","name":"mode","to":"Name of the lock mode held or desired by this process (see Section 13.3.1 and Section 13.2.3)"},{"from":"For a table column, this is the column number (the classid and objid refer to the table itself). For all other object types, this column is zero. Null if the object is not a general database object","name":"objsubid","to":"Column number targeted by the lock (the classid and objid refer to the table itself), or zero if the target is some other general database object, or null if the target is not a general database object"},{"from":"Process ID of the server process holding or awaiting this lock. Null if the lock is held by a prepared transaction.","name":"pid","to":"Process ID of the server process holding or awaiting this lock, or null if the lock is held by a prepared transaction"}],"from":"9.0","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.1","types":[],"unlisted":[]},{"added":["fastpath"],"attributes":[],"description_changed":false,"descriptions":[{"from":"OID of the system catalog containing the object, or null if the object is not a general database object","name":"classid","to":"OID of the system catalog containing the lock target, or null if the target is not a general database object"},{"from":"OID of the database in which the object exists, or zero if the object is a shared object, or null if the object is a transaction ID","name":"database","to":"OID of the database in which the lock target exists, or zero if the target is a shared object, or null if the target is a transaction ID"},{"from":"OID of the object within its system catalog, or null if the object is not a general database object","name":"objid","to":"OID of the lock target within its system catalog, or null if the target is not a general database object"},{"from":"Page number within the relation, or null if the object is not a tuple or relation page","name":"page","to":"Page number targeted by the lock within the relation, or null if the target is not a relation page or tuple"},{"from":"OID of the relation, or null if the object is not a relation or part of a relation","name":"relation","to":"OID of the relation targeted by the lock, or null if the target is not a relation or part of a relation"},{"from":"ID of a transaction, or null if the object is not a transaction ID","name":"transactionid","to":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID"},{"from":"Tuple number within the page, or null if the object is not a tuple","name":"tuple","to":"Tuple number targeted by the lock within the page, or null if the target is not a tuple"},{"from":"Virtual ID of a transaction, or null if the object is not a virtual transaction ID","name":"virtualxid","to":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID"}],"from":"9.1","listing":[],"order":false,"removed":[],"status":"changed","to":"9.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"Type of the lockable object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, or advisory","name":"locktype","to":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, object, userlock, or advisory"}],"from":"9.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.5","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.5","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.6","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.6","listing":[],"order":false,"removed":[],"status":"reworded","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, object, userlock, or advisory","name":"locktype","to":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, or advisory. (See also Table 27.11.)"}],"from":"12","listing":[],"order":false,"removed":[],"status":"reworded","to":"13","types":[],"unlisted":[]},{"added":["waitstart"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, or advisory. (See also Table 27.11.)","name":"locktype","to":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, or advisory. (See also Table 28.11.)"}],"from":"13","listing":[],"order":false,"removed":[],"status":"changed","to":"14","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, or advisory. (See also Table 28.11.)","name":"locktype","to":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, advisory, or applytransaction. (See also Table 28.11.)"},{"from":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID","name":"transactionid","to":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 74"},{"from":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID","name":"virtualxid","to":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 74"}],"from":"15","listing":[],"order":false,"removed":[],"status":"reworded","to":"16","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, advisory, or applytransaction. (See also Table 28.11.)","name":"locktype","to":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, advisory, or applytransaction. (See also Table 27.11.)"},{"from":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 74","name":"transactionid","to":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 66"},{"from":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 74","name":"virtualxid","to":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 66"}],"from":"16","listing":[],"order":false,"removed":[],"status":"reworded","to":"17","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 66","name":"transactionid","to":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 67"},{"from":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 66","name":"virtualxid","to":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 67"}],"from":"17","listing":[],"order":false,"removed":[],"status":"reworded","to":"18","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"True if lock was taken via fast path, false if taken via main lock table","name":"fastpath","to":"True if lock was taken via fast path, false if taken via main lock table (see Section 13.3.1.1)"}],"from":"19","listing":[],"order":false,"removed":[],"status":"reworded","to":"20","types":[],"unlisted":[]}],"column_count":16,"content_hash":"6ddc00d74539687b04ac3f0fd843c8a54f7d9b798b095d908e1a5bf9c8e0bd18","first_version":"7.4","imported_at":"2026-09-30T00:40:55.613793+08:00","kind":"view","last_version":"20","name":"pg_locks","position":44,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"v","shared":false,"source_rev":"english-manuals:1a394737c3f59cb427706a23a53bb587470885cb6d5887f07ead65078241fc63","summary":"The view pg_locks provides access to information about the locks held by active processes within the database server.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_locks","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_locks","SourceRevision":"english-manuals:1a394737c3f59cb427706a23a53bb587470885cb6d5887f07ead65078241fc63","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"Type of the lockable object: relation, extend, frozenid, page, tuple, transactionid, virtualxid, spectoken, object, userlock, advisory, or applytransaction. (See also Table 27.11.)","description_zh":"","documented":true,"documented_name":"locktype","hidden":false,"name":"locktype","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":2,"description":"OID of the database in which the lock target exists, or zero if the target is a shared object, or null if the target is a transaction ID","description_zh":"","documented":true,"documented_name":"database","hidden":false,"name":"database","not_null":false,"references":"pg_database.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":3,"description":"OID of the relation targeted by the lock, or null if the target is not a relation or part of a relation","description_zh":"","documented":true,"documented_name":"relation","hidden":false,"name":"relation","not_null":false,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":4,"description":"Page number targeted by the lock within the relation, or null if the target is not a relation page or tuple","description_zh":"","documented":true,"documented_name":"page","hidden":false,"name":"page","not_null":false,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":5,"description":"Tuple number targeted by the lock within the page, or null if the target is not a tuple","description_zh":"","documented":true,"documented_name":"tuple","hidden":false,"name":"tuple","not_null":false,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":6,"description":"Virtual ID of the transaction targeted by the lock, or null if the target is not a virtual transaction ID; see Chapter 67","description_zh":"","documented":true,"documented_name":"virtualxid","hidden":false,"name":"virtualxid","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":7,"description":"ID of the transaction targeted by the lock, or null if the target is not a transaction ID; Chapter 67","description_zh":"","documented":true,"documented_name":"transactionid","hidden":false,"name":"transactionid","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":8,"description":"OID of the system catalog containing the lock target, or null if the target is not a general database object","description_zh":"","documented":true,"documented_name":"classid","hidden":false,"name":"classid","not_null":false,"references":"pg_class.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":9,"description":"OID of the lock target within its system catalog, or null if the target is not a general database object","description_zh":"","documented":true,"documented_name":"objid","hidden":false,"name":"objid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":10,"description":"Column number targeted by the lock (the classid and objid refer to the table itself), or zero if the target is some other general database object, or null if the target is not a general database object","description_zh":"","documented":true,"documented_name":"objsubid","hidden":false,"name":"objsubid","not_null":false,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":11,"description":"Virtual ID of the transaction that is holding or awaiting this lock","description_zh":"","documented":true,"documented_name":"virtualtransaction","hidden":false,"name":"virtualtransaction","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":12,"description":"Process ID of the server process holding or awaiting this lock, or null if the lock is held by a prepared transaction","description_zh":"","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":13,"description":"Name of the lock mode held or desired by this process (see Section 13.3.1 and Section 13.2.3)","description_zh":"","documented":true,"documented_name":"mode","hidden":false,"name":"mode","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":14,"description":"True if lock is held, false if lock is awaited","description_zh":"","documented":true,"documented_name":"granted","hidden":false,"name":"granted","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":15,"description":"True if lock was taken via fast path, false if taken via main lock table","description_zh":"","documented":true,"documented_name":"fastpath","hidden":false,"name":"fastpath","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":16,"description":"Time when the server process started waiting for this lock, or null if the lock is held. Note that this can be null for a very short period of time after the wait started even though granted is false.","description_zh":"","documented":true,"documented_name":"waitstart","hidden":false,"name":"waitstart","not_null":false,"references":"","type":"timestamptz","type_modifier":-1,"type_oid":1184}],"description":"The view pg_locks provides access to information about the locks held by active processes within the database server. See Chapter 13 for more discussion of locking.\n\npg_locks contains one row per active lockable object, requested lock mode, and relevant process. Thus, the same lockable object might appear many times, if multiple processes are holding or waiting for locks on it. However, an object that currently has no locks on it will not appear at all.\n\nThere are several distinct types of lockable objects: whole relations (e.g., tables), individual pages of relations, individual tuples of relations, transaction IDs (both virtual and permanent IDs), and general database objects (identified by class OID and object OID, in the same way as in pg_description or pg_depend). Also, the right to extend a relation is represented as a separate lockable object, as is the right to update pg_database.datfrozenxid. Also, “advisory” locks can be taken on numbers that have user-defined meanings.","description_zh":"","doc":{"anchor":"id-1.10.5.17.6","file":"view-pg-locks.html","lang":"en","sha256":"3a7d854d209880ee811d10a349a5dc4a13b1496cf08cbdabbdcba73c05958ad2","slug":"18"},"kind":"view","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["locktype","database","relation","page","tuple","virtualxid","transactionid","classid","objid","objsubid","virtualtransaction","pid","mode","granted","fastpath","waitstart"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.5.17.6","file":"view-pg-locks.html","lang":"en","sha256":"3a7d854d209880ee811d10a349a5dc4a13b1496cf08cbdabbdcba73c05958ad2","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["locktype","database","relation","page","tuple","virtualxid","transactionid","classid","objid","objsubid","virtualtransaction","pid","mode","granted","fastpath","waitstart"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_locks","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_locks","Summary":"视图pg_locks提供了对数据库服务器中活动进程持有的锁的信息的访问。有关锁定的更多讨论，请参见第 13 章。\n\npg_locks为每个活动的可锁定对象、请求的锁模式及相关进程的组合提供一行。因此，如果多个进程正在持有或等待锁定它，同一可锁定对象可能会出现多次。但是，当前没有任何锁定的对象将不会出现。\n\n有几种不同类型的可锁定对象：整个关系（例如，表），关系的单个页面，关系的单个元组，事务ID（虚拟和永久ID均包括），以及一般的数据库对象（由类OID和对象OID标识，与pg_description或 pg_depend中的方式相同）。此外，扩展关系的权利被表示为单独的可锁定对象，更新 pg_database.datfrozenxid的权利也是如此。此外，还可以对具有用户定义含义的数字施加“咨询锁”。","BodyHTML":"\u003cp\u003e视图pg_locks提供了对数据库服务器中活动进程持有的锁的信息的访问。有关锁定的更多讨论，请参见第 13 章。\n\npg_locks为每个活动的可锁定对象、请求的锁模式及相关进程的组合提供一行。因此，如果多个进程正在持有或等待锁定它，同一可锁定对象可能会出现多次。但是，当前没有任何锁定的对象将不会出现。\n\n有几种不同类型的可锁定对象：整个关系（例如，表），关系的单个页面，关系的单个元组，事务ID（虚拟和永久ID均包括），以及一般的数据库对象（由类OID和对象OID标识，与pg_description或 pg_depend中的方式相同）。此外，扩展关系的权利被表示为单独的可锁定对象，更新 pg_database.datfrozenxid的权利也是如此。此外，还可以对具有用户定义含义的数字施加“咨询锁”。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"39ac2f77965616eba30a0d2d522bf1c5c6dc0303d6f80b06168ff7b902aa0a1c","Payload":{"columns":[{"description_zh":"可锁定对象的类型：relation，extend，frozenid，page，tuple，transactionid，virtualxid，spectoken，object，userlock，advisory 或 applytransaction。（另请参见表 27.11。）","name":"locktype","type":"text","zh_from":"doc"},{"description_zh":"锁目标存在的数据库的OID，如果目标是一个共享对象则为0，如果目标是一个事务ID则为 NULL","name":"database","type":"oid","zh_from":"doc"},{"description_zh":"作为锁目标的关系的OID，如果目标既不是关系，也不是关系的一部分则此列为 NULL","name":"relation","type":"oid","zh_from":"doc"},{"description_zh":"作为锁目标的页在关系中的页号，如果目标不是一个关系页或元组则此列为 NULL","name":"page","type":"integer","zh_from":"doc"},{"description_zh":"作为锁目标的元组在页中的元组号，如果目标不是一个元组则此列为 NULL","name":"tuple","type":"smallint","zh_from":"doc"},{"description_zh":"作为锁目标的事务的虚拟 ID，如果目标不是虚拟事务 ID，则为 NULL；见第 67 章","name":"virtualxid","type":"text","zh_from":"doc"},{"description_zh":"作为锁目标的事务的 ID，如果目标不是事务 ID，则为 NULL；第 67 章","name":"transactionid","type":"xid","zh_from":"doc"},{"description_zh":"包含锁目标的系统目录的OID，如果目标不是一个普通数据库对象则此列为 NULL","name":"classid","type":"oid","zh_from":"doc"},{"description_zh":"锁目标在它的系统目录中的OID，如果目标不是一个普通数据库对象则为 NULL","name":"objid","type":"oid","zh_from":"doc"},{"description_zh":"锁的目标列号（classid和objid指表本身），如果目标是某种其他普通数据库对象则此列为0，如果目标不是一个普通数据库对象则此列为 NULL","name":"objsubid","type":"smallint","zh_from":"doc"},{"description_zh":"持有这个锁或者正在等待这个锁的事务的虚拟ID","name":"virtualtransaction","type":"text","zh_from":"doc"},{"description_zh":"持有这个锁或者正在等待这个锁的服务器进程的PID，如果此锁被一个预备事务所持有则此列为 NULL","name":"pid","type":"integer","zh_from":"doc"},{"description_zh":"此进程已持有或者希望持有的锁模式的名称（参见第 13.3.1 节和第 13.2.3 节）","name":"mode","type":"text","zh_from":"doc"},{"description_zh":"如果锁已授予则为真，如果锁被等待则为假","name":"granted","type":"boolean","zh_from":"doc"},{"description_zh":"如果锁通过快速路径获得则为真，通过主锁表获得则为假","name":"fastpath","type":"boolean","zh_from":"doc"},{"description_zh":"服务器进程开始等待该锁的时间；如果锁已被授予则为 NULL。注意，在开始等待之后，即使granted为false，该值在极短时间内也可能仍为 NULL。","name":"waitstart","type":"timestamp with time zone","zh_from":"doc"}],"description_zh":"视图pg_locks提供了对数据库服务器中活动进程持有的锁的信息的访问。有关锁定的更多讨论，请参见第 13 章。\n\npg_locks为每个活动的可锁定对象、请求的锁模式及相关进程的组合提供一行。因此，如果多个进程正在持有或等待锁定它，同一可锁定对象可能会出现多次。但是，当前没有任何锁定的对象将不会出现。\n\n有几种不同类型的可锁定对象：整个关系（例如，表），关系的单个页面，关系的单个元组，事务ID（虚拟和永久ID均包括），以及一般的数据库对象（由类OID和对象OID标识，与pg_description或 pg_depend中的方式相同）。此外，扩展关系的权利被表示为单独的可锁定对象，更新 pg_database.datfrozenxid的权利也是如此。此外，还可以对具有用户定义含义的数字施加“咨询锁”。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
