Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1og9aA-0003sh-3a for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2022 18:57:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1og9a7-0003eL-ET for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2022 18:57:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1og9a7-0003eC-3m for pgsql-hackers@lists.postgresql.org; Wed, 05 Oct 2022 18:57:23 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1og9a4-0002Pi-M8 for pgsql-hackers@postgresql.org; Wed, 05 Oct 2022 18:57:22 +0000 Received: by mail-pl1-x634.google.com with SMTP id x6so10895519pll.11 for ; Wed, 05 Oct 2022 11:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=WOTy0EZaD9VcDrL0oHzoE233GmJR2L6u42vuaTOuK9w=; b=DYPEMHSKFO7bIUe5kUysJJ6plujy1WOKPV7ZzHoaiHsRNsuD28UpGIN1uhhpOEf9xW DpKtGj+/iwt8+n2eNgiWS65xZ2D3jOQMgo3ndxDj2sQTqB8MMqUGmi7sr+mbtjojqHge J0mvOdsXk6F1nPM0v2w8XTGxOUd0gAAEq34u/pb4xUgjDdHWpHU3OACqrSBnSzgghulS Pn2Xmp9nf3hNhOx7Ap/iP7KKxgQrbXeOxaRavVKAW5M8CRQnSRQhXlySarZjN4uBgf6O kzIXGt+sYghI8bWxnv3AU2Y2qWvZCZAaFTloGNSrQBmdL7B1+c0QkLmRfE2Xj06iH47s zyMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=WOTy0EZaD9VcDrL0oHzoE233GmJR2L6u42vuaTOuK9w=; b=oydVWtymc9vqhkb7BsvOmbU4r/8NyoSGB+zr43x3sgOZ5HkD9pe8w64Zpq0ULh0OQK Te4chQzeABqKagcJBphNzknxyui/uUJU7l2FqgoeBJZdjHCDYMriSKuQa2PPr6xVYaOX om1tFeqrtP87Qk9X3EIEU5DCjp0OmTnoei03J8oxcyK4dXF5lbbMfRCtTkSWhwFFgMJO CEQ2FWMCy9WhH+CCeFA3WKtCKyrciK4xOmI49uejmeS982MHi2UBRMt+nt4UBA+VciUs /cMmjiEJzgvm/GykgyMc9aVV1g3df7CUWhww9zgQ75wsxy0rJRtUmJmEjXrvCR4Odkgq 4DaA== X-Gm-Message-State: ACrzQf1xyvcPVQU0YbtIt6piE7k0WYlqX2Atahg0m5x/PgPt4XjgNUrS MEJyQHK4BplsnuOP5C5fDTk= X-Google-Smtp-Source: AMsMyM6DzwijH6xOOAXIexQT/AS29hwABMctbOCYg39gDFlWcr9TRgl8wh4xXqMLiJQZcYztEMo6+A== X-Received: by 2002:a17:902:b089:b0:178:54cf:d692 with SMTP id p9-20020a170902b08900b0017854cfd692mr1074055plr.1.1664996239466; Wed, 05 Oct 2022 11:57:19 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id s4-20020a170902ea0400b00176675adbe1sm10837067plg.208.2022.10.05.11.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 11:57:18 -0700 (PDT) Date: Wed, 5 Oct 2022 11:57:16 -0700 From: Nathan Bossart To: Peter Eisentraut Cc: Tom Lane , Benoit =?iso-8859-1?Q?Lobr=E9au?= , Alvaro Herrera , Robert Haas , "Bossart, Nathan" , David Steele , Fujii Masao , "pgsql-hackers@postgresql.org" , Michael Paquier , Magnus Hagander , Stephen Frost Subject: Re: archive modules Message-ID: <20221005185716.GB201192@nathanxps13> References: <9ee5d180-2c32-a1ca-d3d7-63a723f68d9a@enterprisedb.com> <20220914200305.GA2984249@nathanxps13> <37857474-5caa-ccb3-92a3-150ddfe851ab@enterprisedb.com> <2884265.1663188443@sss.pgh.pa.us> <20220914211746.GA2986134@nathanxps13> <2910705.1663193529@sss.pgh.pa.us> <20220914222736.GA3042279@nathanxps13> <20220923161402.GA736566@nathanxps13> <4f66de67-35a0-3fe7-fa61-d618e1bd2c2c@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3lcZGd9BuhuYXNfi" Content-Disposition: inline In-Reply-To: <4f66de67-35a0-3fe7-fa61-d618e1bd2c2c@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 05, 2022 at 07:55:58PM +0200, Peter Eisentraut wrote: > Leaving archive_command empty is an intentional configuration choice. > > What we are talking about here is, arguably, a misconfiguration, so it > should result in an error. Okay. What do you think about something like the attached? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --3lcZGd9BuhuYXNfi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fail_arch.patch" 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(). --3lcZGd9BuhuYXNfi--