diff options
author | Stephen Frost <sfrost@snowman.net> | 2022-04-06 14:41:03 -0400 |
---|---|---|
committer | Stephen Frost <sfrost@snowman.net> | 2022-04-06 14:41:03 -0400 |
commit | 39969e2a1e4d7f5a37f3ef37d53bbfe171e7d77a (patch) | |
tree | 7b1e10c1147783ef0a21b76d78657921696be791 /src/backend/utils/init/postinit.c | |
parent | 14d3f24fa8a21f8a7e66f1fc60253a1e11410bf3 (diff) | |
download | postgresql-39969e2a1e4d7f5a37f3ef37d53bbfe171e7d77a.tar.gz postgresql-39969e2a1e4d7f5a37f3ef37d53bbfe171e7d77a.zip |
Remove exclusive backup mode
Exclusive-mode backups have been deprecated since 9.6 (when
non-exclusive backups were introduced) due to the issues
they can cause should the system crash while one is running and
generally because non-exclusive provides a much better interface.
Further, exclusive backup mode wasn't really being tested (nor was most
of the related code- like being able to log in just to stop an exclusive
backup and the bits of the state machine related to that) and having to
possibly deal with an exclusive backup and the backup_label file
existing during pg_basebackup, pg_rewind, etc, added other complexities
that we are better off without.
This patch removes the exclusive backup mode, the various special cases
for dealing with it, and greatly simplifies the online backup code and
documentation.
Authors: David Steele, Nathan Bossart
Reviewed-by: Chapman Flack
Discussion: https://postgr.es/m/ac7339ca-3718-3c93-929f-99e725d1172c@pgmasters.net
https://postgr.es/m/CAHg+QDfiM+WU61tF6=nPZocMZvHDzCK47Kneyb0ZRULYzV5sKQ@mail.gmail.com
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 6452b42dbff..342169b1958 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -872,24 +872,6 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username, } /* - * If we're trying to shut down, only superusers can connect, and new - * replication connections are not allowed. - */ - if ((!am_superuser || am_walsender) && - MyProcPort != NULL && - MyProcPort->canAcceptConnections == CAC_SUPERUSER) - { - if (am_walsender) - ereport(FATAL, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("new replication connections are not allowed during database shutdown"))); - else - ereport(FATAL, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("must be superuser to connect during database shutdown"))); - } - - /* * Binary upgrades only allowed super-user connections */ if (IsBinaryUpgrade && !am_superuser) |