From 76dd09bbec893c02376e3440a6a86a3b994d804c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 25 Apr 2011 12:00:21 -0400 Subject: 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. --- src/backend/utils/init/postinit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/backend/utils/init/postinit.c') 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 @@ -625,6 +625,16 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username, errmsg("must be superuser to connect during database shutdown"))); } + /* + * 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 -- cgit v1.2.3