Subject: Unexpected message truncation in WaitForAllTransactionsToFinish

From: "cca5507" <[email-masked]>
Date: Fri, 5 Jun 2026 16:30:51 +0800

Hi,

In WaitForAllTransactionsToFinish():

```
		char		activity[64];
		int			rc;

		/* Oldest running xid is older than us, so wait */
		snprintf(activity,
				 sizeof(activity),
				 "Waiting for current transactions to finish (waiting for %u)",
				 waitforxid);
		pgstat_report_activity(STATE_RUNNING, activity);
```

The buffer is not big enough to hold the message if the 'waitforxid' is too big.

How about changing the message to this:

    "Waiting for transactions older than %u to finish"

--
Regards,
ChangAo Chen

---

From: Daniel Gustafsson <[email-masked]>
Date: Fri, 5 Jun 2026 11:45:28 +0200

> On 5 Jun 2026, at 10:30, cca5507 <[email-masked]> wrote:

> The buffer is not big enough to hold the message if the 'waitforxid' is too big.

Nice catch, will fix.

--
Daniel Gustafsson