{"Entry":{"collection":"catalog","key":"pg_stat_activity","name":"pg_stat_activity","aliases":[],"metadata":{"changed_in":["9.1","9.2","9.4","9.6","10","13","14"],"changes":[{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.0","order":false,"removed":[],"status":"reworded","to":"8.1","types":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.1","order":false,"removed":[],"status":"reworded","to":"8.2","types":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.2","order":false,"removed":[],"status":"reworded","to":"8.3","types":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"8.4","order":false,"removed":[],"status":"coverage","to":"9.0","types":[]},{"added":["client_hostname"],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.0","listing":[],"order":false,"removed":[],"status":"changed","to":"9.1","types":[],"unlisted":[]},{"added":["pid","state_change","state","query"],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.1","listing":[],"order":false,"removed":["procpid","current_query"],"status":"changed","to":"9.2","types":[],"unlisted":[]},{"added":["backend_xid","backend_xmin"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.3","listing":[],"order":false,"removed":[],"status":"changed","to":"9.4","types":[],"unlisted":[]},{"added":["wait_event_type","wait_event"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.5","listing":[],"order":false,"removed":["waiting"],"status":"changed","to":"9.6","types":[],"unlisted":[]},{"added":["backend_type"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Time when this process was started, i.e., when the client connected to the server","name":"backend_start","to":"Time when this process was started. For client backends, this is the time the client connected to the server."},{"from":"Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed.","name":"query","to":"Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed. By default the query text is truncated at 1024 bytes; this value can be changed via the parameter track_activity_query_size."},{"from":"Wait event name if backend is currently waiting, otherwise NULL. See Table 28-4 for details.","name":"wait_event","to":"Wait event name if backend is currently waiting, otherwise NULL. See Table 28.4 for details."},{"from":"The type of event for which the backend is waiting, if any; otherwise NULL. Possible values are: LWLockNamed: The backend is waiting for a specific named lightweight lock. Each such lock protects a particular data structure in shared memory. wait_event will contain the name of the lightweight lock. LWLockTranche: The backend is waiting for one of a group of related lightweight locks. All locks in the group perform a similar function; wait_event will identify the general purpose of locks in that group. Lock: The backend is waiting for a heavyweight lock. Heavyweight locks, also known as lock manager locks or simply locks, primarily protect SQL-visible objects such as tables. However, they are also used to ensure mutual exclusion for certain internal operations such as relation extension. wait_event will identify the type of lock awaited. BufferPin: The server process is waiting to access to a data buffer during a period when no other process can be examining that buffer. Buffer pin waits can be protracted if another process holds an open cursor which last read data from the buffer in question.","name":"wait_event_type","to":"The type of event for which the backend is waiting, if any; otherwise NULL. Possible values are: LWLock: The backend is waiting for a lightweight lock. Each such lock protects a particular data structure in shared memory. wait_event will contain a name identifying the purpose of the lightweight lock. (Some locks have specific names; others are part of a group of locks each with a similar purpose.) Lock: The backend is waiting for a heavyweight lock. Heavyweight locks, also known as lock manager locks or simply locks, primarily protect SQL-visible objects such as tables. However, they are also used to ensure mutual exclusion for certain internal operations such as relation extension. wait_event will identify the type of lock awaited. BufferPin: The server process is waiting to access to a data buffer during a period when no other process can be examining that buffer. Buffer pin waits can be protracted if another process holds an open cursor which last read data from the buffer in question. Activity: The server process is idle. This is used by system processes waiting for activity in their main processing loop. wait_event will identify the specific wait point. Extension: The server process is waiting for activity in an extension module. This category is useful for modules to track custom waiting points. Client: The server process is waiting for some activity on a socket from user applications, and that the server expects something to happen that is independent from its internal processes. wait_event will identify the specific wait point. IPC: The server process is waiting for some activity from another process in the server. wait_event will identify the specific wait point. Timeout: The server process is waiting for a timeout to expire. wait_event will identify the specific wait point. IO: The server process is waiting for a IO to complete. wait_event will identify the specific wait point."}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, background worker, background writer, client backend, checkpointer, startup, walreceiver, walsender and walwriter.","name":"backend_type","to":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types."}],"from":"10","listing":[],"order":false,"removed":[],"status":"reworded","to":"11","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Wait event name if backend is currently waiting, otherwise NULL. See Table 28.4 for details.","name":"wait_event","to":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.4 for details."}],"from":"11","listing":[],"order":false,"removed":[],"status":"reworded","to":"12","types":[],"unlisted":[]},{"added":["leader_pid"],"attributes":[],"description_changed":true,"descriptions":[{"from":"TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used","name":"client_port","to":"TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used. If this field is null, it indicates that this is an internal server process."},{"from":"Current overall state of this backend. Possible values are: active: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend.","name":"state","to":"Current overall state of this backend. Possible values are:\n\nactive: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend."},{"from":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.4 for details.","name":"wait_event","to":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.5 through Table 27.13."},{"from":"The type of event for which the backend is waiting, if any; otherwise NULL. Possible values are: LWLock: The backend is waiting for a lightweight lock. Each such lock protects a particular data structure in shared memory. wait_event will contain a name identifying the purpose of the lightweight lock. (Some locks have specific names; others are part of a group of locks each with a similar purpose.) Lock: The backend is waiting for a heavyweight lock. Heavyweight locks, also known as lock manager locks or simply locks, primarily protect SQL-visible objects such as tables. However, they are also used to ensure mutual exclusion for certain internal operations such as relation extension. wait_event will identify the type of lock awaited. BufferPin: The server process is waiting to access to a data buffer during a period when no other process can be examining that buffer. Buffer pin waits can be protracted if another process holds an open cursor which last read data from the buffer in question. Activity: The server process is idle. This is used by system processes waiting for activity in their main processing loop. wait_event will identify the specific wait point. Extension: The server process is waiting for activity in an extension module. This category is useful for modules to track custom waiting points. Client: The server process is waiting for some activity on a socket from user applications, and that the server expects something to happen that is independent from its internal processes. wait_event will identify the specific wait point. IPC: The server process is waiting for some activity from another process in the server. wait_event will identify the specific wait point. Timeout: The server process is waiting for a timeout to expire. wait_event will identify the specific wait point. IO: The server process is waiting for a IO to complete. wait_event will identify the specific wait point.","name":"wait_event_type","to":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 27.4."}],"from":"12","listing":[],"order":false,"removed":[],"status":"changed","to":"13","types":[],"unlisted":[]},{"added":["query_id"],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types.","name":"backend_type","to":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types."},{"from":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.5 through Table 27.13.","name":"wait_event","to":"Wait event name if backend is currently waiting, otherwise NULL. See Table 28.5 through Table 28.13."},{"from":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 27.4.","name":"wait_event_type","to":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 28.4."}],"from":"13","listing":[],"order":false,"removed":[],"status":"changed","to":"14","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types.","name":"backend_type","to":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types."},{"from":"Top-level transaction identifier of this backend, if any.","name":"backend_xid","to":"Top-level transaction identifier of this backend, if any; see Section 74.1."},{"from":"Process ID of the parallel group leader, if this process is a parallel query worker. NULL if this process is a parallel group leader or does not participate in parallel query.","name":"leader_pid","to":"Process ID of the parallel group leader if this process is a parallel query worker, or process ID of the leader apply worker if this process is a parallel apply worker. NULL indicates that this process is a parallel group leader or leader apply worker, or does not participate in any parallel operation."}],"from":"15","listing":[],"order":false,"removed":[],"status":"reworded","to":"16","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender and walwriter. In addition, background workers registered by extensions may have additional types.","name":"backend_type","to":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender, walwriter and walsummarizer. In addition, background workers registered by extensions may have additional types."},{"from":"Top-level transaction identifier of this backend, if any; see Section 74.1.","name":"backend_xid","to":"Top-level transaction identifier of this backend, if any; see Section 66.1."},{"from":"Wait event name if backend is currently waiting, otherwise NULL. See Table 28.5 through Table 28.13.","name":"wait_event","to":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.5 through Table 27.13."},{"from":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 28.4.","name":"wait_event_type","to":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 27.4."}],"from":"16","listing":[],"order":false,"removed":[],"status":"reworded","to":"17","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Top-level transaction identifier of this backend, if any; see Section 66.1.","name":"backend_xid","to":"Top-level transaction identifier of this backend, if any; see Section 67.1."},{"from":"Current overall state of this backend. Possible values are:\n\nactive: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend.","name":"state","to":"Current overall state of this backend. Possible values are:\n\nstarting: The backend is in initial startup. Client authentication is performed during this phase. active: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend."}],"from":"17","listing":[],"order":false,"removed":[],"status":"reworded","to":"18","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender, walwriter and walsummarizer. In addition, background workers registered by extensions may have additional types.","name":"backend_type","to":"Type of current backend. Possible types are:\n\narchiver: The WAL archiver, active when archive_mode is enabled. autovacuum launcher: The background process that launches autovacuum workers, active when autovacuum is on. autovacuum worker: A background process running VACUUM or ANALYZE on a single table. background writer: The background process that makes sure that there are enough clean buffers in shared buffers. checkpointer: The background process that performs checkpoints regularly. client backend: The server process performing work for a regular database connection. datachecksums launcher: The background process that launches data checksum workers. datachecksums worker: A background process that calculates data checksums for all pages in one database. io worker: A background process performing asynchronous I/O, active when io_method is set to worker. logical replication apply worker: A background process that applies data modifications on a logical subscriber. logical replication launcher: The background process that launches logical replication worker processes for subscriptions. logical replication parallel worker: A background process that applies data modifications on a logical subscriber for a subscription with streaming = parallel. logical replication sequencesync worker: A background process that replicates sequence data on a logical subscriber. logical replication tablesync worker: A background process that copies table data on a logical subscriber for a subscription with copy_data = true. parallel worker: A background process that helps a backend process to perform operations in parallel. REPACK decoding worker: A background process that decodes WAL for REPACK (CONCURRENTLY). slotsync worker: The background process that synchronizes logical replication slots on a streaming replication standby server, active when sync_replication_slots is set to on. standalone backend: The backend process when PostgreSQL was started in Single-User Mode. startup: The background process that replays WAL during crash recovery, archive recovery or streaming replication. walreceiver: The background process that receives WAL records from a WAL sender, active in streaming replication standby mode. walsender: A background process that sends WAL records to receivers (during streaming replication) or decodes WAL and sends the decoded information (during logical replication). walsummarizer: The background process that creates summaries from WAL for use with incremental backup, active when summarize_wal is on. walwriter: The background process that persists WAL records from WAL buffers to disk.\n\nIn addition, background workers registered by extensions may have additional types."}],"from":"19","listing":[],"order":false,"removed":[],"status":"reworded","to":"20","types":[],"unlisted":[]}],"column_count":22,"content_hash":"5173e9bc104c88a52bf7753c61354942b37414de2e9e663a9bc9d878cf7643a0","derived_content_hash":"709b8596da630644c45eb29329ffa029fb32f88cf951508ed11e999f74316d02","documentation_refresh":{"batch":"20261113","original_source_rev":"catalog-bilingual-repair:596c67af4af6f903ed566f224cc34aa4d1d582d6b690b41575031d33896e2440","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"7.4","imported_at":"2026-09-30T00:40:55.84296+08:00","kind":"statistics","last_version":"20","name":"pg_stat_activity","position":81,"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":"catalog-bilingual-repair:596c67af4af6f903ed566f224cc34aa4d1d582d6b690b41575031d33896e2440","summary":"The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.","summary_zh":"pg_stat_activity 视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。"}},"Definition":{"Collection":"catalog","Key":"pg_stat_activity","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_stat_activity","SourceRevision":"catalog-bilingual-repair:596c67af4af6f903ed566f224cc34aa4d1d582d6b690b41575031d33896e2440","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"OID of the database this backend is connected to","description_zh":"这个后端连接到的数据库的 OID","documented":true,"documented_name":"datid","hidden":false,"name":"datid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":2,"description":"Name of the database this backend is connected to","description_zh":"这个后端连接到的数据库的名称","documented":true,"documented_name":"datname","hidden":false,"name":"datname","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":3,"description":"Process ID of this backend","description_zh":"这个后端的进程 ID","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":4,"description":"Process ID of the parallel group leader if this process is a parallel query worker, or process ID of the leader apply worker if this process is a parallel apply worker. NULL indicates that this process is a parallel group leader or leader apply worker, or does not participate in any parallel operation.","description_zh":"如果该进程是并行查询工作进程，则为并行组领导者的进程 ID；如果该进程是并行应用工作进程，则为领导者应用工作进程的进程 ID。NULL 表示该进程是并行组领导者或领导者应用工作进程，或者不参与任何并行操作。","documented":true,"documented_name":"leader_pid","hidden":false,"name":"leader_pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":5,"description":"OID of the user logged into this backend","description_zh":"登录到这个后端的用户的 OID","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":6,"description":"Name of the user logged into this backend","description_zh":"登录到此后端的用户名称","documented":true,"documented_name":"usename","hidden":false,"name":"usename","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":7,"description":"Name of the application that is connected to this backend","description_zh":"连接到此后端的应用名称","documented":true,"documented_name":"application_name","hidden":false,"name":"application_name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":8,"description":"IP address of the client connected to this backend. If this field is null, it indicates either that the client is connected via a Unix socket on the server machine or that this is an internal process such as autovacuum.","description_zh":"连接到这个后端的客户端的 IP 地址。如果这个字段为空值，它表示客户端通过服务器机器上的一个 Unix 套接字连接或者这是一个内部进程，如自动清理。","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":9,"description":"Host name of the connected client, as reported by a reverse DNS lookup of client_addr. This field will only be non-null for IP connections, and only when log_hostname is enabled.","description_zh":"已连接的客户端的主机名，由 client_addr 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 log_hostname 被启用时才会非空。","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":10,"description":"TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used. If this field is null, it indicates that this is an internal server process.","description_zh":"客户端用于与此后端通信的 TCP 端口号，如果使用 Unix 套接字，则为 -1。如果该字段为空值，它表示这是一个内部服务器进程。","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":11,"description":"Time when this process was started. For client backends, this is the time the client connected to the server.","description_zh":"这个进程被启动的时间。对客户端后端来说，这就是客户端连接到服务器的时间。","documented":true,"documented_name":"backend_start","hidden":false,"name":"backend_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":12,"description":"Time when this process' current transaction was started, or null if no transaction is active. If the current query is the first of its transaction, this column is equal to the query_start column.","description_zh":"这个进程的当前事务被启动的时间，如果没有活动事务则为空值。如果当前查询是其事务中的第一个查询，这一列等于 query_start 列。","documented":true,"documented_name":"xact_start","hidden":false,"name":"xact_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":13,"description":"Time when the currently active query was started, or if state is not active, when the last query was started","description_zh":"当前活动查询开始的时间；如果 state 不是 active，则为上一个查询的开始时间","documented":true,"documented_name":"query_start","hidden":false,"name":"query_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":14,"description":"Time when the state was last changed","description_zh":"state 上一次发生改变的时间","documented":true,"documented_name":"state_change","hidden":false,"name":"state_change","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":15,"description":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 27.4.","description_zh":"后端正在等待的事件类型（如果有）；否则为空值。请参阅表 27.4。","documented":true,"documented_name":"wait_event_type","hidden":false,"name":"wait_event_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":16,"description":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.5 through Table 27.13.","description_zh":"如果此后端当前正在等待，则返回等待事件名称，否则为空值。请参阅表 27.5 到表 27.13。","documented":true,"documented_name":"wait_event","hidden":false,"name":"wait_event","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":17,"description":"Current overall state of this backend. Possible values are:\n\nstarting: The backend is in initial startup. Client authentication is performed during this phase. active: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend.","description_zh":"该后端当前的总体状态。可能的值为：\n\nstarting：后端正处于初始启动阶段。客户端认证在此阶段执行。 active：后端正在执行一个查询。idle：后端正在等待新的客户端命令。idle in transaction：后端处于事务中，但当前没有执行查询。idle in transaction (aborted)：该状态与 idle in transaction 类似，但事务中的某个语句导致了错误。fastpath function call：后端正在执行一个快速路径函数。disabled：如果在此后端中禁用了 track_activities，就会报告此状态。","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":18,"description":"Top-level transaction identifier of this backend, if any; see Section 67.1.","description_zh":"这个后端的顶层事务 ID（如果存在）；请参阅第 67.1 节。","documented":true,"documented_name":"backend_xid","hidden":false,"name":"backend_xid","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":19,"description":"The current backend's xmin horizon.","description_zh":"当前后端的 xmin 视界。","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":20,"description":"Identifier of this backend's most recent query. If state is active this field shows the identifier of the currently executing query. In all other states, it shows the identifier of last query that was executed. Query identifiers are not computed by default so this field will be null unless compute_query_id parameter is enabled or a third-party module that computes query identifiers is configured.","description_zh":"这个后端的最近查询的标识符。如果 state 是 active，这个字段显示当前正在执行的查询的标识符。在所有其他状态，它显示执行的最后一个查询的标识符。默认不计算查询标识符，因此该字段将为空值，除非启用 compute_query_id 参数或配置了计算查询标识符的第三方模块。","documented":true,"documented_name":"query_id","hidden":false,"name":"query_id","not_null":false,"references":"","type":"bigint","type_modifier":-1,"type_oid":20,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":21,"description":"Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed. By default the query text is truncated at 1024 bytes; this value can be changed via the parameter track_activity_query_size.","description_zh":"这个后端最近查询的文本。如果 state 为 active，这个字段显示当前正在执行的查询。在所有其他状态下，它显示上一个被执行的查询。默认情况下，查询文本会被截断至 1024 个字节，这个值可以通过参数 track_activity_query_size 更改。","documented":true,"documented_name":"query","hidden":false,"name":"query","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":22,"description":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender, walwriter and walsummarizer. In addition, background workers registered by extensions may have additional types.","description_zh":"当前后端的类型。可能的类型为 autovacuum launcher、autovacuum worker、logical replication launcher、logical replication worker、parallel worker、background writer、client backend、checkpointer、archiver、standalone backend、startup、walreceiver、walsender、walwriter 和 walsummarizer。此外，由扩展注册的后台工作进程还可能有额外的类型。","documented":true,"documented_name":"backend_type","hidden":false,"name":"backend_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"}],"description":"The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.","description_zh":"pg_stat_activity 视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。","description_zh_html":"\u003cp\u003epg_stat_activity 视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。\u003c/p\u003e\u003cdiv class=\"table\" id=\"PG-STAT-ACTIVITY-VIEW\"\u003e\u003cp class=\"title\"\u003e\u003cstrong\u003e表 27.3. \u003ccode class=\"structname\"\u003epg_stat_activity\u003c/code\u003e 视图\u003c/strong\u003e\u003c/p\u003e\u003cdiv class=\"table-contents\"\u003e\u003ctable border=\"1\" class=\"table\" summary=\"pg_stat_activity 视图\"\u003e\u003ccolgroup\u003e\u003ccol/\u003e\u003c/colgroup\u003e\u003cthead\u003e\u003ctr\u003e\u003cth class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n       列类型\n      \u003c/p\u003e\n\u003cp\u003e\n       描述\n      \u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003edatid\u003c/code\u003e \u003ccode class=\"type\"\u003eoid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个后端连接到的数据库的 OID\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003edatname\u003c/code\u003e \u003ccode class=\"type\"\u003ename\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个后端连接到的数据库的名称\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003epid\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个后端的进程 ID\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eleader_pid\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       如果该进程是并行查询工作进程，则为并行组领导者的进程 ID；如果该进程是并行应用工作进程，则为领导者应用工作进程的进程 ID。\u003ccode class=\"literal\"\u003eNULL\u003c/code\u003e 表示该进程是并行组领导者或领导者应用工作进程，或者不参与任何并行操作。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eusesysid\u003c/code\u003e \u003ccode class=\"type\"\u003eoid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       登录到这个后端的用户的 OID\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eusename\u003c/code\u003e \u003ccode class=\"type\"\u003ename\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       登录到此后端的用户名称\n     \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eapplication_name\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       连接到此后端的应用名称\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_addr\u003c/code\u003e \u003ccode class=\"type\"\u003einet\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       连接到这个后端的客户端的 IP 地址。如果这个字段为空值，它表示客户端通过服务器机器上的一个 Unix 套接字连接或者这是一个内部进程，如自动清理。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_hostname\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       已连接的客户端的主机名，由 \u003ccode class=\"structfield\"\u003eclient_addr\u003c/code\u003e 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-logging.html#GUC-LOG-HOSTNAME\"\u003elog_hostname\u003c/a\u003e 被启用时才会非空。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003eclient_port\u003c/code\u003e \u003ccode class=\"type\"\u003einteger\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       客户端用于与此后端通信的 TCP 端口号，如果使用 Unix 套接字，则为 \u003ccode class=\"literal\"\u003e-1\u003c/code\u003e。如果该字段为空值，它表示这是一个内部服务器进程。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_start\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个进程被启动的时间。对客户端后端来说，这就是客户端连接到服务器的时间。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003exact_start\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个进程的当前事务被启动的时间，如果没有活动事务则为空值。如果当前查询是其事务中的第一个查询，这一列等于 \u003ccode class=\"structfield\"\u003equery_start\u003c/code\u003e 列。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003equery_start\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       当前活动查询开始的时间；如果 \u003ccode class=\"structfield\"\u003estate\u003c/code\u003e 不是 \u003ccode class=\"literal\"\u003eactive\u003c/code\u003e，则为上一个查询的开始时间\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003estate_change\u003c/code\u003e \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n\u003ccode class=\"structfield\"\u003estate\u003c/code\u003e 上一次发生改变的时间\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ewait_event_type\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       后端正在等待的事件类型（如果有）；否则为空值。请参阅\u003ca class=\"xref\" href=\"/zh/docs/18/monitoring-stats.html#WAIT-EVENT-TABLE\" title=\"表 27.4. 等待事件类型\"\u003e表 27.4\u003c/a\u003e。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ewait_event\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       如果此后端当前正在等待，则返回等待事件名称，否则为空值。请参阅\u003ca class=\"xref\" href=\"/zh/docs/18/monitoring-stats.html#WAIT-EVENT-ACTIVITY-TABLE\" title=\"表 27.5. Activity类型的等待事件\"\u003e表 27.5\u003c/a\u003e 到\u003ca class=\"xref\" href=\"/zh/docs/18/monitoring-stats.html#WAIT-EVENT-TIMEOUT-TABLE\" title=\"表 27.13.  Timeout类型的等待事件\"\u003e表 27.13\u003c/a\u003e。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003estate\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e该后端当前的总体状态。可能的值为：\u003c/p\u003e\u003cdiv class=\"itemizedlist\"\u003e\u003cul class=\"itemizedlist\" style=\"list-style-type: disc; \"\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003estarting\u003c/code\u003e：后端正处于初始启动阶段。客户端认证在此阶段执行。\n         \u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003eactive\u003c/code\u003e：后端正在执行一个查询。\u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003eidle\u003c/code\u003e：后端正在等待新的客户端命令。\u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003eidle in transaction\u003c/code\u003e：后端处于事务中，但当前没有执行查询。\u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003eidle in transaction (aborted)\u003c/code\u003e：该状态与 \u003ccode class=\"literal\"\u003eidle in transaction\u003c/code\u003e 类似，但事务中的某个语句导致了错误。\u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003efastpath function call\u003c/code\u003e：后端正在执行一个快速路径函数。\u003c/p\u003e\u003c/li\u003e\u003cli class=\"listitem\"\u003e\u003cp\u003e\u003ccode class=\"literal\"\u003edisabled\u003c/code\u003e：如果在此后端中禁用了 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-statistics.html#GUC-TRACK-ACTIVITIES\"\u003etrack_activities\u003c/a\u003e，就会报告此状态。\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_xid\u003c/code\u003e \u003ccode class=\"type\"\u003exid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e这个后端的顶层事务 ID（如果存在）；请参阅\u003ca class=\"xref\" href=\"/zh/docs/18/transaction-id.html\" title=\"67.1. 事务与标识符\"\u003e第 67.1 节\u003c/a\u003e。\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_xmin\u003c/code\u003e \u003ccode class=\"type\"\u003exid\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       当前后端的 \u003ccode class=\"literal\"\u003exmin\u003c/code\u003e 视界。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003equery_id\u003c/code\u003e \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n      这个后端的最近查询的标识符。如果 \u003ccode class=\"structfield\"\u003estate\u003c/code\u003e 是 \u003ccode class=\"literal\"\u003eactive\u003c/code\u003e，这个字段显示当前正在执行的查询的标识符。在所有其他状态，它显示执行的最后一个查询的标识符。默认不计算查询标识符，因此该字段将为空值，除非启用 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-statistics.html#GUC-COMPUTE-QUERY-ID\"\u003ecompute_query_id\u003c/a\u003e 参数或配置了计算查询标识符的第三方模块。\n     \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003equery\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e\n       这个后端最近查询的文本。如果 \u003ccode class=\"structfield\"\u003estate\u003c/code\u003e 为 \u003ccode class=\"literal\"\u003eactive\u003c/code\u003e，这个字段显示当前正在执行的查询。在所有其他状态下，它显示上一个被执行的查询。默认情况下，查询文本会被截断至 1024 个字节，这个值可以通过参数 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-statistics.html#GUC-TRACK-ACTIVITY-QUERY-SIZE\"\u003etrack_activity_query_size\u003c/a\u003e 更改。\n      \u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"catalog_table_entry\"\u003e\u003cp class=\"column_definition\"\u003e\n\u003ccode class=\"structfield\"\u003ebackend_type\u003c/code\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e\n\u003c/p\u003e\n\u003cp\u003e当前后端的类型。可能的类型为 \u003ccode class=\"literal\"\u003eautovacuum launcher\u003c/code\u003e、\u003ccode class=\"literal\"\u003eautovacuum worker\u003c/code\u003e、\u003ccode class=\"literal\"\u003elogical replication launcher\u003c/code\u003e、\u003ccode class=\"literal\"\u003elogical replication worker\u003c/code\u003e、\u003ccode class=\"literal\"\u003eparallel worker\u003c/code\u003e、\u003ccode class=\"literal\"\u003ebackground writer\u003c/code\u003e、\u003ccode class=\"literal\"\u003eclient backend\u003c/code\u003e、\u003ccode class=\"literal\"\u003echeckpointer\u003c/code\u003e、\u003ccode class=\"literal\"\u003earchiver\u003c/code\u003e、\u003ccode class=\"literal\"\u003estandalone backend\u003c/code\u003e、\u003ccode class=\"literal\"\u003estartup\u003c/code\u003e、\u003ccode class=\"literal\"\u003ewalreceiver\u003c/code\u003e、\u003ccode class=\"literal\"\u003ewalsender\u003c/code\u003e、\u003ccode class=\"literal\"\u003ewalwriter\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003ewalsummarizer\u003c/code\u003e。此外，由扩展注册的后台工作进程还可能有额外的类型。\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\u003c/div\u003e","doc":{"anchor":"PG-STAT-ACTIVITY-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","slug":"18"},"documentation_revision":{"inputs":[{"file":"monitoring-stats.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","version":"18.7"},{"file":"monitoring-stats.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"1ddb6576fe569e029a1c776c82e7add6be8e4f41705bcd8f66f4347fe23372b6","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"kind":"statistics","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["datid","datname","pid","leader_pid","usesysid","usename","application_name","client_addr","client_hostname","client_port","backend_start","xact_start","query_start","state_change","wait_event_type","wait_event","state","backend_xid","backend_xmin","query_id","query","backend_type"],"runtime_verified":false,"source":"english-manual","sources":[{"evidence":[{"build_id":107,"kind":"same-version-manual","locale":"zh-Hans","page":"monitoring-stats.html","sha256":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","version":"18"}],"kind":"catalog-bilingual-repair","prior_source_revision":"english-manuals:58bd8381dc972d9c242b31952698d0425dd377170672b014b5de42119170cf9e","version":"18"}],"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"PG-STAT-ACTIVITY-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"a97e4aa05484b41cec1f4c9b0b9c5a083596a056982e5d5ba0db1dd8d49961fb","slug":"18"},"sources":[{"evidence":[{"build_id":107,"kind":"same-version-manual","locale":"zh-Hans","page":"monitoring-stats.html","sha256":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","version":"18"}],"kind":"catalog-bilingual-repair","prior_source_revision":"english-manuals:58bd8381dc972d9c242b31952698d0425dd377170672b014b5de42119170cf9e","version":"18"}]},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["datid","datname","pid","leader_pid","usesysid","usename","application_name","client_addr","client_hostname","client_port","backend_start","xact_start","query_start","state_change","wait_event_type","wait_event","state","backend_xid","backend_xmin","query_id","query","backend_type"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_stat_activity","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_stat_activity","Summary":"The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.","BodyHTML":"\u003cp\u003eThe pg_stat_activity view will have one row per server process, showing information related to the current activity of that process.\u003c/p\u003e","SourceRevision":"catalog-bilingual-repair:596c67af4af6f903ed566f224cc34aa4d1d582d6b690b41575031d33896e2440","ContentHash":"b30d8a9734ecdab23410cfecd8ebcc2d587b010bb467c54676eeb5eedb75a1bb","Payload":{"columns":[{"array_dimensions":0,"attnum":1,"description":"OID of the database this backend is connected to","description_zh":"这个后端连接到的数据库的 OID","documented":true,"documented_name":"datid","hidden":false,"name":"datid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":2,"description":"Name of the database this backend is connected to","description_zh":"这个后端连接到的数据库的名称","documented":true,"documented_name":"datname","hidden":false,"name":"datname","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":3,"description":"Process ID of this backend","description_zh":"这个后端的进程 ID","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":4,"description":"Process ID of the parallel group leader if this process is a parallel query worker, or process ID of the leader apply worker if this process is a parallel apply worker. NULL indicates that this process is a parallel group leader or leader apply worker, or does not participate in any parallel operation.","description_zh":"如果该进程是并行查询工作进程，则为并行组领导者的进程 ID；如果该进程是并行应用工作进程，则为领导者应用工作进程的进程 ID。NULL 表示该进程是并行组领导者或领导者应用工作进程，或者不参与任何并行操作。","documented":true,"documented_name":"leader_pid","hidden":false,"name":"leader_pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":5,"description":"OID of the user logged into this backend","description_zh":"登录到这个后端的用户的 OID","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":6,"description":"Name of the user logged into this backend","description_zh":"登录到此后端的用户名称","documented":true,"documented_name":"usename","hidden":false,"name":"usename","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":7,"description":"Name of the application that is connected to this backend","description_zh":"连接到此后端的应用名称","documented":true,"documented_name":"application_name","hidden":false,"name":"application_name","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":8,"description":"IP address of the client connected to this backend. If this field is null, it indicates either that the client is connected via a Unix socket on the server machine or that this is an internal process such as autovacuum.","description_zh":"连接到这个后端的客户端的 IP 地址。如果这个字段为空值，它表示客户端通过服务器机器上的一个 Unix 套接字连接或者这是一个内部进程，如自动清理。","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":9,"description":"Host name of the connected client, as reported by a reverse DNS lookup of client_addr. This field will only be non-null for IP connections, and only when log_hostname is enabled.","description_zh":"已连接的客户端的主机名，由 client_addr 的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有 log_hostname 被启用时才会非空。","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":10,"description":"TCP port number that the client is using for communication with this backend, or -1 if a Unix socket is used. If this field is null, it indicates that this is an internal server process.","description_zh":"客户端用于与此后端通信的 TCP 端口号，如果使用 Unix 套接字，则为 -1。如果该字段为空值，它表示这是一个内部服务器进程。","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":11,"description":"Time when this process was started. For client backends, this is the time the client connected to the server.","description_zh":"这个进程被启动的时间。对客户端后端来说，这就是客户端连接到服务器的时间。","documented":true,"documented_name":"backend_start","hidden":false,"name":"backend_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":12,"description":"Time when this process' current transaction was started, or null if no transaction is active. If the current query is the first of its transaction, this column is equal to the query_start column.","description_zh":"这个进程的当前事务被启动的时间，如果没有活动事务则为空值。如果当前查询是其事务中的第一个查询，这一列等于 query_start 列。","documented":true,"documented_name":"xact_start","hidden":false,"name":"xact_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":13,"description":"Time when the currently active query was started, or if state is not active, when the last query was started","description_zh":"当前活动查询开始的时间；如果 state 不是 active，则为上一个查询的开始时间","documented":true,"documented_name":"query_start","hidden":false,"name":"query_start","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":14,"description":"Time when the state was last changed","description_zh":"state 上一次发生改变的时间","documented":true,"documented_name":"state_change","hidden":false,"name":"state_change","not_null":false,"references":"","type":"timestamp with time zone","type_modifier":-1,"type_oid":1184,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":15,"description":"The type of event for which the backend is waiting, if any; otherwise NULL. See Table 27.4.","description_zh":"后端正在等待的事件类型（如果有）；否则为空值。请参阅表 27.4。","documented":true,"documented_name":"wait_event_type","hidden":false,"name":"wait_event_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":16,"description":"Wait event name if backend is currently waiting, otherwise NULL. See Table 27.5 through Table 27.13.","description_zh":"如果此后端当前正在等待，则返回等待事件名称，否则为空值。请参阅表 27.5 到表 27.13。","documented":true,"documented_name":"wait_event","hidden":false,"name":"wait_event","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":17,"description":"Current overall state of this backend. Possible values are:\n\nstarting: The backend is in initial startup. Client authentication is performed during this phase. active: The backend is executing a query. idle: The backend is waiting for a new client command. idle in transaction: The backend is in a transaction, but is not currently executing a query. idle in transaction (aborted): This state is similar to idle in transaction, except one of the statements in the transaction caused an error. fastpath function call: The backend is executing a fast-path function. disabled: This state is reported if track_activities is disabled in this backend.","description_zh":"该后端当前的总体状态。可能的值为：\n\nstarting：后端正处于初始启动阶段。客户端认证在此阶段执行。 active：后端正在执行一个查询。idle：后端正在等待新的客户端命令。idle in transaction：后端处于事务中，但当前没有执行查询。idle in transaction (aborted)：该状态与 idle in transaction 类似，但事务中的某个语句导致了错误。fastpath function call：后端正在执行一个快速路径函数。disabled：如果在此后端中禁用了 track_activities，就会报告此状态。","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":18,"description":"Top-level transaction identifier of this backend, if any; see Section 67.1.","description_zh":"这个后端的顶层事务 ID（如果存在）；请参阅第 67.1 节。","documented":true,"documented_name":"backend_xid","hidden":false,"name":"backend_xid","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":19,"description":"The current backend's xmin horizon.","description_zh":"当前后端的 xmin 视界。","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":20,"description":"Identifier of this backend's most recent query. If state is active this field shows the identifier of the currently executing query. In all other states, it shows the identifier of last query that was executed. Query identifiers are not computed by default so this field will be null unless compute_query_id parameter is enabled or a third-party module that computes query identifiers is configured.","description_zh":"这个后端的最近查询的标识符。如果 state 是 active，这个字段显示当前正在执行的查询的标识符。在所有其他状态，它显示执行的最后一个查询的标识符。默认不计算查询标识符，因此该字段将为空值，除非启用 compute_query_id 参数或配置了计算查询标识符的第三方模块。","documented":true,"documented_name":"query_id","hidden":false,"name":"query_id","not_null":false,"references":"","type":"bigint","type_modifier":-1,"type_oid":20,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":21,"description":"Text of this backend's most recent query. If state is active this field shows the currently executing query. In all other states, it shows the last query that was executed. By default the query text is truncated at 1024 bytes; this value can be changed via the parameter track_activity_query_size.","description_zh":"这个后端最近查询的文本。如果 state 为 active，这个字段显示当前正在执行的查询。在所有其他状态下，它显示上一个被执行的查询。默认情况下，查询文本会被截断至 1024 个字节，这个值可以通过参数 track_activity_query_size 更改。","documented":true,"documented_name":"query","hidden":false,"name":"query","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"},{"array_dimensions":0,"attnum":22,"description":"Type of current backend. Possible types are autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, archiver, standalone backend, startup, walreceiver, walsender, walwriter and walsummarizer. In addition, background workers registered by extensions may have additional types.","description_zh":"当前后端的类型。可能的类型为 autovacuum launcher、autovacuum worker、logical replication launcher、logical replication worker、parallel worker、background writer、client backend、checkpointer、archiver、standalone backend、startup、walreceiver、walsender、walwriter 和 walsummarizer。此外，由扩展注册的后台工作进程还可能有额外的类型。","documented":true,"documented_name":"backend_type","hidden":false,"name":"backend_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25,"zh_from":"same-version-manual"}],"description":"The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process."}},"RequestedLocale":"en","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}
