@ -205,14 +205,24 @@ char *ListenAddresses;
/*
* SuperuserReservedConnections is the number of backends reserved for
* superuser use . This number is taken out of the pool size given by
* MaxConnections so number of backend slots available to non - superusers is
* ( MaxConnections - SuperuserReservedConnections ) . Note what this really
* means is " if there are <= SuperuserReservedConnections connections
* available , only superusers can make new connections " --- pre-existing
* superuser connections don ' t count against the limit .
* superuser use , and ReservedConnections is the number of backends reserved
* for use by roles with privileges of the pg_use_reserved_connections
* predefined role . These are taken out of the pool of MaxConnections backend
* slots , so the number of backend slots available for roles that are neither
* superuser nor have privileges of pg_use_reserved_connections is
* ( MaxConnections - SuperuserReservedConnections - ReservedConnections ) .
*
* If the number of remaining slots is less than or equal to
* SuperuserReservedConnections , only superusers can make new connections . If
* the number of remaining slots is greater than SuperuserReservedConnections
* but less than or equal to
* ( SuperuserReservedConnections + ReservedConnections ) , only superusers and
* roles with privileges of pg_use_reserved_connections can make new
* connections . Note that pre - existing superuser and
* pg_use_reserved_connections connections don ' t count against the limits .
*/
int SuperuserReservedConnections ;
int ReservedConnections ;
/* The socket(s) we're listening to. */
# define MAXLISTEN 64
@ -908,11 +918,12 @@ PostmasterMain(int argc, char *argv[])
/*
* Check for invalid combinations of GUC settings .
*/
if ( SuperuserReservedConnections > = MaxConnections )
if ( SuperuserReservedConnections + ReservedConnections > = MaxConnections )
{
write_stderr ( " %s: superuser_reserved_connections (%d) must be less than max_connections (%d) \n " ,
write_stderr ( " %s: superuser_reserved_connections (%d) plus reserved_connections (%d) must be less than max_connections (%d) \n " ,
progname ,
SuperuserReservedConnections , MaxConnections ) ;
SuperuserReservedConnections , ReservedConnections ,
MaxConnections ) ;
ExitPostmaster ( 1 ) ;
}
if ( XLogArchiveMode > ARCHIVE_MODE_OFF & & wal_level = = WAL_LEVEL_MINIMAL )