diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d750290f13..bb4d985f35 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3597,9 +3597,11 @@ include_dir 'conf.d' 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, archiving will fail. 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 @@ -3624,7 +3626,9 @@ include_dir 'conf.d' 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, archiving will fail. Otherwise, the specified shared library is used for archiving. For more information, see and . diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 3868cd7bd3..56dcc0dce5 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -838,6 +838,12 @@ LoadArchiveLibrary(void) memset(&ArchiveContext, 0, sizeof(ArchiveModuleCallbacks)); + if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0') + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("both archive_command and archive_library specified"), + errdetail("Only one of archive_command, archive_library may be set."))); + /* * If shell archiving is enabled, use our special initialization function. * Otherwise, load the library and call its _PG_archive_module_init().