diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/archive/shell_archive.c | 7 | ||||
-rw-r--r-- | src/backend/postmaster/pgarch.c | 8 |
2 files changed, 13 insertions, 2 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 diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index bb0eb13a898..f97035ca03c 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -88,6 +88,7 @@ typedef struct PgArchData } PgArchData; char *XLogArchiveLibrary = ""; +char *arch_module_check_errdetail_string; /* ---------- @@ -401,12 +402,17 @@ pgarch_ArchiverCopyLoop(void) */ HandlePgArchInterrupts(); + /* Reset variables that might be set by the callback */ + arch_module_check_errdetail_string = NULL; + /* can't do anything if not configured ... */ if (ArchiveCallbacks->check_configured_cb != NULL && !ArchiveCallbacks->check_configured_cb(archive_module_state)) { ereport(WARNING, - (errmsg("archive_mode enabled, yet archiving is not configured"))); + (errmsg("archive_mode enabled, yet archiving is not configured"), + arch_module_check_errdetail_string ? + errdetail_internal("%s", arch_module_check_errdetail_string) : 0)); return; } |