aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-10-03 19:19:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-10-03 19:19:09 +0000
commit565c97bea5498cc1c491eeec91676780a405d1a6 (patch)
tree444791f00ee98e091139f800e6a7a1866d1e249b /src
parentedf497dec96e7c69618c3654ecb7769342906f1c (diff)
downloadpostgresql-565c97bea5498cc1c491eeec91676780a405d1a6.tar.gz
postgresql-565c97bea5498cc1c491eeec91676780a405d1a6.zip
In a bootstrap process or standalone backend, set MaxBackends = 1
to avoid unnecessary consumption of semaphores.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/init/postinit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index ee4abdff883..9ac71c6a812 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.116 2002/09/04 20:31:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.117 2002/10/03 19:19:09 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -172,11 +172,14 @@ InitCommunication(void)
if (!IsUnderPostmaster) /* postmaster already did this */
{
/*
- * we're running a postgres backend by itself with no front end or
- * postmaster. Create private "shmem" and semaphores. Setting
- * MaxBackends = 16 is arbitrary.
+ * We're running a postgres bootstrap process or a standalone backend.
+ * Create private "shmem" and semaphores. Force MaxBackends to 1 so
+ * that we don't allocate more resources than necessary.
*/
- CreateSharedMemoryAndSemaphores(true, 16, 0);
+ SetConfigOption("max_connections", "1",
+ PGC_POSTMASTER, PGC_S_OVERRIDE);
+
+ CreateSharedMemoryAndSemaphores(true, MaxBackends, 0);
}
}