mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user