summaryrefslogtreecommitdiff
path: root/src/backend/catalog
diff options
context:
space:
mode:
authorMasahiko Sawada <msawada@postgresql.org>2025-12-09 11:23:45 -0800
committerMasahiko Sawada <msawada@postgresql.org>2025-12-09 11:23:45 -0800
commitab40db3852dfa093b64c9266dd372fee414e993f (patch)
treee0e45ec04ae0932a3c0b9abd35905e5d03efc986 /src/backend/catalog
parent0d789520619803cf6629ebf980e116d733b6756f (diff)
Add started_by column to pg_stat_progress_analyze view.
The new column, started_by, indicates the initiator of the analyze ('manual' or 'autovacuum'), helping users and monitoring tools to better understand ANALYZE behavior. Bump catalog version. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Reviewed-by: Yu Wang <wangyu_runtime@163.com> Discussion: https://postgr.es/m/CAA5RZ0suoicwxFeK_eDkUrzF7s0BVTaE7M%2BehCpYcCk5wiECpw%40mail.gmail.com
Diffstat (limited to 'src/backend/catalog')
-rw-r--r--src/backend/catalog/system_views.sql5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index e929c3547d5..0a0f95f6bb9 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -1247,7 +1247,10 @@ CREATE VIEW pg_stat_progress_analyze AS
S.param6 AS child_tables_total,
S.param7 AS child_tables_done,
CAST(S.param8 AS oid) AS current_child_table_relid,
- S.param9 / 1000000::double precision AS delay_time
+ S.param9 / 1000000::double precision AS delay_time,
+ CASE S.param10 WHEN 1 THEN 'manual'
+ WHEN 2 THEN 'autovacuum'
+ ELSE NULL END AS started_by
FROM pg_stat_get_progress_info('ANALYZE') AS S
LEFT JOIN pg_database D ON S.datid = D.oid;