aboutsummaryrefslogtreecommitdiff
path: root/src/backend/archive/shell_archive.c
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-03-04 15:41:42 -0600
committerNathan Bossart <nathan@postgresql.org>2024-03-04 15:41:42 -0600
commit2c29e7fc95b24f5ccfec0d2db458d2130606f446 (patch)
tree1d05b2693f525b2203bf6001163f47266b900a27 /src/backend/archive/shell_archive.c
parente5bc9454e527b1cba97553531d8d4992892fdeef (diff)
downloadpostgresql-2c29e7fc95b24f5ccfec0d2db458d2130606f446.tar.gz
postgresql-2c29e7fc95b24f5ccfec0d2db458d2130606f446.zip
Add macro for customizing an archiving WARNING message.
Presently, if an archive module's check_configured_cb callback returns false, a generic WARNING message is emitted, which unfortunately provides no actionable details about the reason why the module is not configured. This commit introduces a macro that archive module authors can use to add a DETAIL line to this WARNING message. Co-authored-by: Tung Nguyen Reviewed-by: Daniel Gustafsson, Álvaro Herrera Discussion: https://postgr.es/m/4109578306242a7cd5661171647e11b2%40oss.nttdata.com
Diffstat (limited to 'src/backend/archive/shell_archive.c')
-rw-r--r--src/backend/archive/shell_archive.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/archive/shell_archive.c b/src/backend/archive/shell_archive.c
index c95b732495c..bff0ab800d0 100644
--- a/src/backend/archive/shell_archive.c
+++ b/src/backend/archive/shell_archive.c
@@ -45,7 +45,12 @@ shell_archive_init(void)
static bool
shell_archive_configured(ArchiveModuleState *state)
{
- return XLogArchiveCommand[0] != '\0';
+ if (XLogArchiveCommand[0] != '\0')
+ return true;
+
+ arch_module_check_errdetail("%s is not set.",
+ "archive_command");
+ return false;
}
static bool