{"Entry":{"collection":"metric","key":"pg_stat_activity-query","name":"pg_stat_activity.query","aliases":["query","pg_stat_activity"],"metadata":{"aliases":["query","pg_stat_activity"],"category":"pg_stat_activity","content_hash":"2c5f620c91f1c3d6317357f2b792cc67daca81927f45f1d0be3e19def85f89c2","derived_content_hash":"c503837a5805599bb85859b73d3184e54cf6d1030e4f87b893901ff3378cdd32","imported_at":"2026-09-30T00:40:45.281903+08:00","name":"pg_stat_activity.query","name_zh":"","slug":"pg_stat_activity-query","summary":"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."}},"Definition":{"Collection":"metric","Key":"pg_stat_activity-query","SourceDatabase":"center","Version":"18","SourceTable":"statistics_metric","SourceKey":"pg_stat_activity-query","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"field":"query","sql_type":"text","units_mentioned":["bytes"],"view":"pg_stat_activity"},"comparison_hash":"fe77b896e52f9ae21f44149448c055eede55de16ad720b36c50220026956c283","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 更改。","description_zh_html":"\u003cp\u003epg_stat_activity.query 统计字段。\u003c/p\u003e\u003cdl\u003e\u003cdt\u003e视图\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003epg_stat_activity\u003c/code\u003e\u003c/dd\u003e\u003cdt\u003e字段\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003equery\u003c/code\u003e\u003c/dd\u003e\u003cdt\u003eSQL 类型\u003c/dt\u003e\u003cdd\u003e\u003ccode\u003etext\u003c/code\u003e\u003c/dd\u003e\u003c/dl\u003e\u003ch3\u003e同版本中文手册定义\u003c/h3\u003e\u003cp\u003e这个后端最近查询的文本。如果 state 为 active，这个字段显示当前正在执行的查询。在所有其他状态下，它显示上一个被执行的查询。默认情况下，查询文本会被截断至 1024 个字节，这个值可以通过参数 track_activity_query_size 更改。\u003c/p\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/monitoring-stats.html#\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","documented":true,"facts":[{"label":"View","value":"pg_stat_activity"},{"label":"Field","value":"query"},{"label":"SQL type","value":"text"},{"label":"Units named in the field definition","value":"bytes"},{"label":"Reset observation","value":"No stats_reset field is documented for this view"}],"facts_zh":[{"label":"视图","value":"pg_stat_activity"},{"label":"字段","value":"query"},{"label":"SQL 类型","value":"text"},{"label":"字段定义记载的单位","value":"bytes"},{"label":"重置条件","value":"手册未为此视图记载 stats_reset 字段"}],"field":"query","manual_html":"","manual_path":"/docs/18/monitoring-stats.html","related":[{"label":"pg_stat_activity columns","url":"/wiki/catalog/pg_stat_activity/?v=18"},{"label":"Statistics collection and reset functions","url":"/docs/18/monitoring-stats.html"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[{"paragraphs":["The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process."],"title":"View semantics"},{"paragraphs":["Read the same-version statistics collection and view documentation below for reset scope and visibility. No per-field reset rule is inferred from the field name."],"title":"Collection and reset context"},{"code":"SELECT query FROM pg_catalog.pg_stat_activity;","paragraphs":["Example query; no execution result or measured value is asserted."],"title":"Inspect this field"}],"sections_zh":[{"paragraphs":["pg_stat_activity 视图每个服务器进程将有一行，显示与该进程当前活动相关的信息。"],"title":"视图语义"},{"paragraphs":["重置范围和可见性请参阅下方同版本的统计信息收集与视图文档。不根据字段名称推断各字段的重置规则。"],"title":"采集与重置语义"},{"code":"SELECT query FROM pg_catalog.pg_stat_activity;","paragraphs":["示例查询；不表示已执行，也不提供实测值。"],"title":"查看此字段"}],"signature":"SELECT query FROM pg_catalog.pg_stat_activity;","source_only":false,"sources":[{"label":"PostgreSQL 18 English manual","path":"monitoring-stats.html","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","url":"/docs/18/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW"}],"sql_type":"text","tables":[],"tables_zh":[],"units_mentioned":["bytes"],"view":"pg_stat_activity","zh_from":{"authored_translation":"source-derived-structured-summary","body_sha256":"d8d534f3739979347c105d80488af735bf7e04b08ca2da77dc34ee9312835989","kind":"same-version-chinese-manual-with-source-derived-structured-summary","manual":{"anchor":"","build_id":107,"column":"query","extraction":"exact-catalog-field","locale":"zh-Hans","page_key":"monitoring-stats.html","source_hash":"0274aac7991450316bcf7be44635653b6d896fb00e321242c1b6674cb05c2e53","source_revision":"unknown:rendered-translation-baseline","translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/monitoring-stats.html#","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/monitoring-stats.html","release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"PostgreSQL 18 English manual","path":"monitoring-stats.html","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","url":"/docs/18/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW"}]},"MeasuredEvidence":{}},"Text":{"Collection":"metric","Key":"pg_stat_activity-query","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_stat_activity.query","Summary":"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.","BodyHTML":"\u003cp\u003eText of this backend\u0026#39;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.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"95ff9f7cbefc9647a0bd7be21714258ebe6b9a99943c953bddef25a0381db0e5","Payload":{"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."],"manual_html":"","related":[{"label":"pg_stat_activity columns","url":"/wiki/catalog/pg_stat_activity/?v=18"},{"label":"Statistics collection and reset functions","url":"/docs/18/monitoring-stats.html"}],"sections":[{"paragraphs":["The pg_stat_activity view will have one row per server process, showing information related to the current activity of that process."],"title":"View semantics"},{"paragraphs":["Read the same-version statistics collection and view documentation below for reset scope and visibility. No per-field reset rule is inferred from the field name."],"title":"Collection and reset context"},{"code":"SELECT query FROM pg_catalog.pg_stat_activity;","paragraphs":["Example query; no execution result or measured value is asserted."],"title":"Inspect this field"}],"tables":[]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
