diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-04-25 12:00:21 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-04-25 12:00:21 -0400 |
commit | 76dd09bbec893c02376e3440a6a86a3b994d804c (patch) | |
tree | 721a384f3511d2dc72642afeea48629019a15bb3 /src/backend/utils/init/postinit.c | |
parent | 02e6a115cc6149551527a45545fd1ef8d37e6aa0 (diff) | |
download | postgresql-76dd09bbec893c02376e3440a6a86a3b994d804c.tar.gz postgresql-76dd09bbec893c02376e3440a6a86a3b994d804c.zip |
Add postmaster/postgres undocumented -b option for binary upgrades.
This option turns off autovacuum, prevents non-super-user connections,
and enables oid setting hooks in the backend. The code continues to use
the old autoavacuum disable settings for servers with earlier catalog
versions.
This includes a catalog version bump to identify servers that support
the -b option.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r-- | src/backend/utils/init/postinit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index a4c5d4c69ab..1f6fba5f752 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -626,6 +626,16 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username, } /* + * Binary upgrades only allowed super-user connections + */ + if (IsBinaryUpgrade && !am_superuser) + { + ereport(FATAL, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("must be superuser to connect in binary upgrade mode"))); + } + + /* * The last few connections slots are reserved for superusers. Although * replication connections currently require superuser privileges, we * don't allow them to consume the reserved slots, which are intended for |