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);
}
/*