From e5e1f6dc795da65d430d59a813643739bed6cadb Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Fri, 5 Jun 2026 17:25:56 +0200 Subject: [PATCH] Reword activity message to avoid truncation The message sent to pg_stat_activity when waiting for transactions to end was long enough that it could get truncated when the xid included in the string grew large. Fix by rewording to avoid truncation, using a similar message in the logical replication code as inspiration. Author: Daniel Gustafsson Reported-by: ChangAo Chen Discussion: https://postgr.es/m/tencent_47CA9CE2F91FF4D81D875E162AD69AA4900A@qq.com --- src/backend/postmaster/datachecksum_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/postmaster/datachecksum_state.c b/src/backend/postmaster/datachecksum_state.c index a49a31d1281..a6fdcf114ec 100644 --- a/src/backend/postmaster/datachecksum_state.c +++ b/src/backend/postmaster/datachecksum_state.c @@ -1005,7 +1005,7 @@ WaitForAllTransactionsToFinish(void) /* Oldest running xid is older than us, so wait */ snprintf(activity, sizeof(activity), - "Waiting for current transactions to finish (waiting for %u)", + "Waiting for transactions older than %u to end", waitforxid); pgstat_report_activity(STATE_RUNNING, activity);