On 18.11.25 22:35, Peter Smith wrote:
On Wed, Nov 19, 2025 at 2:39 AM Álvaro Herrera <[email protected]> wrote:
On 2025-Nov-12, Peter Smith wrote:
It is tempting to implement a "--silent" mode, but if I did that, I
would then feel obliged to document and test it. I don't want to go
further down this rabbit hole for what was originally supposed to be
trivial logging.
Yeah, I understand.
So, I am calling it quits for this 0001 patch.
Perhaps it's still of some use to push changes for everything except
the pg_resetwal? Or if you prefer to just abandon the whole patch,
that is OK too. Thanks for trying.
Got it. I pushed it for the other programs and marked the CF entry as
committed -- thanks for the patches and the discussion.
Thanks for pushing!
I have a follow-up for this. Earlier in this thread it was asked to
combine the dry-run info message into one string with a newline. But I
think this doesn't really fit the message style guidelines. I suggest
to use a primary plus detail style here too. How about the attached patch?
From 09e5fcedec79fceb024e4d02980d8c0a09805c62 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 7 May 2026 11:14:10 +0200
Subject: [PATCH] Split dry-run messages into primary and detail
---
src/bin/pg_archivecleanup/pg_archivecleanup.c | 6 ++++--
src/bin/pg_basebackup/pg_createsubscriber.c | 6 ++++--
src/bin/pg_combinebackup/pg_combinebackup.c | 6 ++++--
src/bin/pg_rewind/pg_rewind.c | 6 ++++--
src/bin/scripts/vacuumdb.c | 6 ++++--
5 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c
b/src/bin/pg_archivecleanup/pg_archivecleanup.c
index ab686b4748c..3492dab64d7 100644
--- a/src/bin/pg_archivecleanup/pg_archivecleanup.c
+++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c
@@ -376,8 +376,10 @@ main(int argc, char **argv)
}
if (dryrun)
- pg_log_info("Executing in dry-run mode.\n"
- "No files will be removed.");
+ {
+ pg_log_info("executing in dry-run mode");
+ pg_log_info_detail("No files will be removed.");
+ }
/*
* Check archive exists and other initialization if required.
diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c
b/src/bin/pg_basebackup/pg_createsubscriber.c
index 4d705778454..0a9b11184f5 100644
--- a/src/bin/pg_basebackup/pg_createsubscriber.c
+++ b/src/bin/pg_basebackup/pg_createsubscriber.c
@@ -2514,8 +2514,10 @@ main(int argc, char **argv)
}
if (dry_run)
- pg_log_info("Executing in dry-run mode.\n"
- "The target directory will not be
modified.");
+ {
+ pg_log_info("executing in dry-run mode");
+ pg_log_info_detail("The target directory will not be
modified.");
+ }
pg_log_info("validating publisher connection string");
pub_base_conninfo = get_base_conninfo(opt.pub_conninfo_str,
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c
b/src/bin/pg_combinebackup/pg_combinebackup.c
index d13bf63eb1e..767b8b9e499 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -243,8 +243,10 @@ main(int argc, char *argv[])
opt.manifest_checksums = CHECKSUM_TYPE_NONE;
if (opt.dry_run)
- pg_log_info("Executing in dry-run mode.\n"
- "The target directory will not be
modified.");
+ {
+ pg_log_info("executing in dry-run mode");
+ pg_log_info_detail("The target directory will not be
modified.");
+ }
/* Check that the platform supports the requested copy method. */
if (opt.copy_method == COPY_METHOD_CLONE)
diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c
index 9d745d4b25b..2e86fd158d0 100644
--- a/src/bin/pg_rewind/pg_rewind.c
+++ b/src/bin/pg_rewind/pg_rewind.c
@@ -302,8 +302,10 @@ main(int argc, char **argv)
/* Ok, we have all the options and we're ready to start. */
if (dry_run)
- pg_log_info("Executing in dry-run mode.\n"
- "The target directory will not be
modified.");
+ {
+ pg_log_info("executing in dry-run mode");
+ pg_log_info_detail("The target directory will not be
modified.");
+ }
/* First, connect to remote server. */
if (connstr_source)
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index ccc7f88a291..f8158ca6a78 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -308,8 +308,10 @@ main(int argc, char *argv[])
"missing-stats-only", "analyze-only",
"analyze-in-stages");
if (vacopts.dry_run && !vacopts.quiet)
- pg_log_info("Executing in dry-run mode.\n"
- "No commands will be sent to the
server.");
+ {
+ pg_log_info("executing in dry-run mode");
+ pg_log_info_detail("No commands will be sent to the server.");
+ }
ret = vacuuming_main(&cparams, dbname, maintenance_db, &vacopts,
&objects, tbl_count,
--
2.54.0