This parameter can only be set in the postgresql.conf
- file or on the server command line. It is ignored unless
+ file or on the server command line. It is only used if
archive_mode was enabled at server start and
- archive_library is set to an empty string.
+ archive_library is set to an empty string. If both
+ archive_command and archive_library
+ are set, an error will be raised.
If archive_command is an empty string (the default) while
archive_mode is enabled (and archive_library
is set to an empty string), WAL archiving is temporarily
The library to use for archiving completed WAL file segments. If set to
an empty string (the default), archiving via shell is enabled, and
- is used. Otherwise, the specified
+ is used. If both
+ archive_command and archive_library
+ are set, an error will be raised. Otherwise, the specified
shared library is used for archiving. The WAL archiver process is
restarted by the postmaster when this parameter changes. For more
information, see and
ConfigReloadPending = false;
ProcessConfigFile(PGC_SIGHUP);
+ if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0')
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("both archive_command and archive_library set"),
+ errdetail("Only one of archive_command, archive_library may be set.")));
+
archiveLibChanged = strcmp(XLogArchiveLibrary, archiveLib) != 0;
pfree(archiveLib);
{
ArchiveModuleInit archive_init;
+ if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0')
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("both archive_command and archive_library set"),
+ errdetail("Only one of archive_command, archive_library may be set.")));
+
memset(&ArchiveContext, 0, sizeof(ArchiveModuleCallbacks));
/*