Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVsBE-009Jue-0n for pgsql-docs@arkaria.postgresql.org; Wed, 17 Dec 2025 14:07:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVsBD-00D6SL-0b for pgsql-docs@arkaria.postgresql.org; Wed, 17 Dec 2025 14:07:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVsBC-00D6SD-2Z for pgsql-docs@lists.postgresql.org; Wed, 17 Dec 2025 14:07:03 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVsBB-001EsY-17 for pgsql-docs@lists.postgresql.org; Wed, 17 Dec 2025 14:07:03 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id DCA3D4C24EB for ; Wed, 17 Dec 2025 15:06:59 +0100 (CET) Received: from s981.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id C90B64C335C; Wed, 17 Dec 2025 15:06:59 +0100 (CET) Received: from s473.loopia.se (unknown [172.22.191.6]) by s981.loopia.se (Postfix) with ESMTP id C4EBA22B174A; Wed, 17 Dec 2025 15:06:59 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001] autolearn=disabled Authentication-Results: s473.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s980.loopia.se ([172.22.191.6]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with UTF8LMTP id b86l15nC6I4H; Wed, 17 Dec 2025 15:06:59 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id 522742201691; Wed, 17 Dec 2025 15:06:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1765980419; bh=/EAnTUjhfimiFGmQBUdha9QZRaDd3ALwxjulSRye8V4=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=vesqJGphUK4mTcdc/8kqA8XE5Bkw78xSPrr6EyFHzgr7TikBv5vwd7z1ad1vYF3Cq mLLLGtDQLfnDqBzWk40vqVD3odYQ9+IfN1bTPIx66AhUEDg1LqXG2GvemlucnmsxdB lOuzJXX/7EJuDmjomFwjreWP/0V0HwqTfs/QFxziPLdqQxheHbB/kxFp8atS0ZkzJ/ W2s0BxKG5yaRFf5piHj18wxKhxieuJAHk/gjYoX1oN/HLuH3DquuagBiGkr8b9taOC iX7tvJ3qozkyN0CCWMppC/2ltJXW9bkmlKi2a7o1gCov5KVL+iMkfMRt347BziiUiy HNZEbfu6udZrw== From: Daniel Gustafsson Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_19B747B0-6C25-4C1B-9FE0-416078BFAA58" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.2\)) Subject: Re: missing documentation detail? Date: Wed, 17 Dec 2025 15:06:48 +0100 In-Reply-To: Cc: "camac2025@yahoo.com" , "pgsql-docs@lists.postgresql.org" To: "David G. Johnston" References: <176593231445.978860.2300752490245961611@wrigleys.postgresql.org> X-Mailer: Apple Mail (2.3776.700.51.11.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_19B747B0-6C25-4C1B-9FE0-416078BFAA58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 17 Dec 2025, at 14:20, David G. Johnston = wrote: > This isn=E2=80=99t a good place to request feature enhancements. = There isn=E2=80=99t an issue with the documentation - the program = doesn=E2=80=99t provide multiple conditional exit codes. >=20 > Post a patch to -hackers or a feature request to -general (mailing = list). Absolutely right, that's the best way to propose new (or changes to) = features. The proposed change here seems pretty reasonable and might be as simple = as the (untested) attached, modeled around pg_amcheck. I noticed that = pg_amcheck doesn't document its different return values either which seems like an oversight. -- Daniel Gustafsson =EF=BF=BC= --Apple-Mail=_19B747B0-6C25-4C1B-9FE0-416078BFAA58 Content-Type: multipart/mixed; boundary="Apple-Mail=_83BA4F52-880D-4E9B-9B50-7E6F442FB903" --Apple-Mail=_83BA4F52-880D-4E9B-9B50-7E6F442FB903 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 17 Dec 2025, = at 14:20, David G. Johnston <david.g.johnston@gmail.com> = wrote:

This = isn=E2=80=99t a good place to request feature enhancements.  There = isn=E2=80=99t an issue with the documentation - the program doesn=E2=80=99= t provide multiple conditional exit codes.

Post = a patch to -hackers or a feature request to -general (mailing = list).

Absolutely = right, that's the best way to propose new (or changes to) = features.
The proposed change here seems pretty reasonable and = might be as simple as the
(untested) attached, modeled around = pg_amcheck.  I noticed that pg_amcheck
doesn't document = its different return values either which seems like = an
oversight.

--
Daniel Gustafsson

= --Apple-Mail=_83BA4F52-880D-4E9B-9B50-7E6F442FB903 Content-Disposition: attachment; filename=pg_verifybackup_exit.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="pg_verifybackup_exit.diff" Content-Transfer-Encoding: 7bit diff --git a/doc/src/sgml/ref/pg_amcheck.sgml b/doc/src/sgml/ref/pg_amcheck.sgml index ef2bdfd19ae..7ad7889677e 100644 --- a/doc/src/sgml/ref/pg_amcheck.sgml +++ b/doc/src/sgml/ref/pg_amcheck.sgml @@ -68,6 +68,13 @@ PostgreSQL documentation dbname can also be a connection string. + + + If pg_amcheck encounters a problem, the program + return value will be 2, if there is a problem with the + parameters passed to the program the return value will be + 1. + diff --git a/doc/src/sgml/ref/pg_verifybackup.sgml b/doc/src/sgml/ref/pg_verifybackup.sgml index 61c12975e4a..aa979e56bfb 100644 --- a/doc/src/sgml/ref/pg_verifybackup.sgml +++ b/doc/src/sgml/ref/pg_verifybackup.sgml @@ -120,6 +120,13 @@ PostgreSQL documentation In contrast, the data file integrity checks should work with any version of the server that generates a backup_manifest file. + + + If pg_verifybackup encounters a problem with the backup, + the program return value will be 2, if there is a problem + with the parameters passed to the program the return value will be + 1. + diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c index c9b24df7c05..0bc967268cb 100644 --- a/src/bin/pg_verifybackup/pg_verifybackup.c +++ b/src/bin/pg_verifybackup/pg_verifybackup.c @@ -514,7 +514,7 @@ report_manifest_error(JsonManifestParseContext *context, const char *fmt,...) pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap); va_end(ap); - exit(1); + exit(2); } /* @@ -1238,7 +1238,7 @@ report_backup_error(verifier_context *context, const char *restrict fmt,...) context->saw_any_error = true; if (context->exit_on_error) - exit(1); + exit(2); } /* @@ -1253,7 +1253,7 @@ report_fatal_error(const char *restrict fmt,...) pg_log_generic_v(PG_LOG_ERROR, PG_LOG_PRIMARY, gettext(fmt), ap); va_end(ap); - exit(1); + exit(2); } /* --Apple-Mail=_83BA4F52-880D-4E9B-9B50-7E6F442FB903 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
--Apple-Mail=_83BA4F52-880D-4E9B-9B50-7E6F442FB903-- --Apple-Mail=_19B747B0-6C25-4C1B-9FE0-416078BFAA58--