1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

This patch reserves the last superuser_reserved_connections slots for

connections by the superuser only.

This patch replaces the last patch I sent a couple of days ago.

It closes a connection that has not been authorised by a superuser if it would
leave less than the GUC variable ReservedBackends
(superuser_reserved_connections in postgres.conf) backend process slots free
in the SISeg. This differs to the first patch which only reserved the last
ReservedBackends slots in the procState array. This has made the free slot
test more expensive due to the use of a lock.

After thinking about a comment on the first patch I've also made it a fatal
error if the number of reserved slots is not less than the maximum number of
connections.

Nigel J. Andrews
This commit is contained in:
Bruce Momjian
2002-08-29 21:02:12 +00:00
parent 1761990e38
commit 626eca697c
9 changed files with 90 additions and 21 deletions

View File

@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.106 2002/06/20 20:29:42 momjian Exp $
* $Id: miscadmin.h,v 1.107 2002/08/29 21:02:12 momjian Exp $
*
* NOTES
* some of the information in this file should be moved to
@ -179,6 +179,7 @@ extern bool NetServer;
extern bool EnableSSL;
extern bool SilentMode;
extern int MaxBackends;
extern int ReservedBackends;
extern int NBuffers;
extern int PostPortNumber;
extern int Unix_socket_permissions;