{"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":"f090bd4d044b370ed1d8aedd543d0488d0392a33410f4f64d696085688afe5e6","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":"english-manuals:58bd8381dc972d9c242b31952698d0425dd377170672b014b5de42119170cf9e","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":""}},"Definition":{"Collection":"catalog","Key":"pg_stat_activity","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_stat_activity","SourceRevision":"english-manuals:58bd8381dc972d9c242b31952698d0425dd377170672b014b5de42119170cf9e","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"OID of the database this backend is connected to","description_zh":"","documented":true,"documented_name":"datid","hidden":false,"name":"datid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"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},{"array_dimensions":0,"attnum":3,"description":"Process ID of this backend","description_zh":"","documented":true,"documented_name":"pid","hidden":false,"name":"pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"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":"","documented":true,"documented_name":"leader_pid","hidden":false,"name":"leader_pid","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":5,"description":"OID of the user logged into this backend","description_zh":"","documented":true,"documented_name":"usesysid","hidden":false,"name":"usesysid","not_null":false,"references":"","type":"oid","type_modifier":-1,"type_oid":26},{"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},{"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},{"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":"","documented":true,"documented_name":"client_addr","hidden":false,"name":"client_addr","not_null":false,"references":"","type":"inet","type_modifier":-1,"type_oid":869},{"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":"","documented":true,"documented_name":"client_hostname","hidden":false,"name":"client_hostname","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"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":"","documented":true,"documented_name":"client_port","hidden":false,"name":"client_port","not_null":false,"references":"","type":"integer","type_modifier":-1,"type_oid":23},{"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},{"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":"","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},{"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":"","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},{"array_dimensions":0,"attnum":14,"description":"Time when the state was last changed","description_zh":"","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},{"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":"","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},{"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":"","documented":true,"documented_name":"wait_event","hidden":false,"name":"wait_event","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"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":"","documented":true,"documented_name":"state","hidden":false,"name":"state","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":18,"description":"Top-level transaction identifier of this backend, if any; see Section 67.1.","description_zh":"","documented":true,"documented_name":"backend_xid","hidden":false,"name":"backend_xid","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":19,"description":"The current backend's xmin horizon.","description_zh":"","documented":true,"documented_name":"backend_xmin","hidden":false,"name":"backend_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"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":"","documented":true,"documented_name":"query_id","hidden":false,"name":"query_id","not_null":false,"references":"","type":"bigint","type_modifier":-1,"type_oid":20},{"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":"","documented":true,"documented_name":"query","hidden":false,"name":"query","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"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":"","documented":true,"documented_name":"backend_type","hidden":false,"name":"backend_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25}],"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":"","doc":{"anchor":"PG-STAT-ACTIVITY-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"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"},"ManualEvidence":{"doc":{"anchor":"PG-STAT-ACTIVITY-VIEW","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"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":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_stat_activity","Summary":"pg_stat_activity视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。","BodyHTML":"\u003cp\u003epg_stat_activity视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"5656c8b5a82e64c79cb942d8c5c4c19d434834afdf9365a432f8f6236c7aee20","Payload":{"columns":[{"description_zh":"这个后端连接到的数据库的OID","name":"datid","type":"oid","zh_from":"doc"},{"description_zh":"这个后端连接到的数据库的名称","name":"datname","type":"name","zh_from":"doc"},{"description_zh":"这个后端的进程 ID","name":"pid","type":"integer","zh_from":"doc"},{"description_zh":"如果该进程是并行查询工作进程，则为并行组领导者的进程 ID；如果该进程是并行应用工作进程，则为领导者应用工作进程的进程 ID。NULL 表示该进程是并行组领导者或领导者应用工作进程，或者不参与任何并行操作。","name":"leader_pid","type":"integer","zh_from":"doc"},{"description_zh":"登录到这个后端的用户的 OID","name":"usesysid","type":"oid","zh_from":"doc"},{"description_zh":"登录到此后端的用户名称","name":"usename","type":"name","zh_from":"doc"},{"description_zh":"连接到此后端的应用名称","name":"application_name","type":"text","zh_from":"doc"},{"description_zh":"连接到这个后端的客户端的 IP 地址。如果这个字段为空值，它表示客户端通过服务器机器上的一个 Unix 套接字连接或者这是一个内部进程，如自动清理。","name":"client_addr","type":"inet","zh_from":"doc"},{"description_zh":"已连接的客户端的主机名，由client_addr的反向 DNS 查找报告。这个字段将只对 IP 连接非空，并且只有log_hostname被启用时才会非空。","name":"client_hostname","type":"text","zh_from":"doc"},{"description_zh":"客户端用于与此后端通信的TCP端口号，如果使用Unix套接字，则为-1。如果该字段为空值，它表示这是一个内部服务器进程。","name":"client_port","type":"integer","zh_from":"doc"},{"description_zh":"这个进程被启动的时间。对客户端后端来说，这就是客户端连接到服务器的时间。","name":"backend_start","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"这个进程的当前事务被启动的时间，如果没有活动事务则为空值。如果当前查询是其事务中的第一个查询，这一列等于query_start列。","name":"xact_start","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"当前活动查询开始的时间；如果state不是active，则为上一个查询的开始时间","name":"query_start","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"state上一次发生改变的时间","name":"state_change","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"后端正在等待的事件类型（如果有）；否则为空值。请参阅表 27.4。","name":"wait_event_type","type":"text","zh_from":"doc"},{"description_zh":"如果此后端当前正在等待，则返回等待事件名称，否则为空值。请参阅表 27.5到表 27.13。","name":"wait_event","type":"text","zh_from":"doc"},{"description_zh":"该后端当前的总体状态。可能的值为：","name":"state","type":"text","zh_from":"doc"},{"description_zh":"这个后端的顶层事务 ID（如果存在）；请参阅第 67.1 节。","name":"backend_xid","type":"xid","zh_from":"doc"},{"description_zh":"当前后端的xmin视界。","name":"backend_xmin","type":"xid","zh_from":"doc"},{"description_zh":"这个后端的最近查询的标识符。如果state是active，这个字段显示当前正在执行的查询的标识符。在所有其他状态，它显示执行的最后一个查询的标识符。默认不计算查询标识符，因此该字段将为空值，除非启用compute_query_id参数或配置了计算查询标识符的第三方模块。","name":"query_id","type":"bigint","zh_from":"doc"},{"description_zh":"这个后端最近查询的文本。如果state为active，这个字段显示当前正在执行的查询。在所有其他状态下，它显示上一个被执行的查询。默认情况下，查询文本会被截断至1024个字节，这个值可以通过参数track_activity_query_size更改。","name":"query","type":"text","zh_from":"doc"},{"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。此外，由扩展注册的后台工作进程还可能有额外的类型。","name":"backend_type","type":"text","zh_from":"doc"}],"description_zh":"pg_stat_activity视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。","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}
