[PATCH] Fix error message in RemoveWalSummaryIfOlderThan to indicate file removal failure
zengman <zengman@halodbtech.com>
From: zengman <zengman@halodbtech.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-02-01T14:43:27Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-error-message-in-RemoveWalSummaryIfOlderThan-to-.patch (application/octet-stream) patch 0001
Hi all,
I noticed a small issue. In `RemoveWalSummaryIfOlderThan`,an `unlink()` failure incorrectly logs "could not stat file", likely a copy-paste error.
I updated it to "could not remove file". No functional changes.
```
diff --git a/src/backend/backup/walsummary.c b/src/backend/backup/walsummary.c
index 21164faac7e..4ee510092f9 100644
--- a/src/backend/backup/walsummary.c
+++ b/src/backend/backup/walsummary.c
@@ -251,7 +251,7 @@ RemoveWalSummaryIfOlderThan(WalSummaryFile *ws, time_t cutoff_time)
if (unlink(path) != 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not stat file \"%s\": %m", path)));
+ errmsg("could not remove file \"%s\": %m", path)));
ereport(DEBUG2,
(errmsg_internal("removing file \"%s\"", path)));
}
```
--
regards,
Man Zeng
Commits
-
Fix error message in RemoveWalSummaryIfOlderThan()
- 5995135f1303 17.8 landed
- ab61f00874e5 18.2 landed
- a9afa021e95f 19 (unreleased) landed