Set MaxBackends only on bootstrap and standalone modes
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Jan 2013 20:49:06 +0000 (17:49 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Jan 2013 20:57:56 +0000 (17:57 -0300)
... not on auxiliary processes.  I managed to overlook the fact that I
had disabled assertions on my HEAD checkout long ago.

Hopefully this will turn the buildfarm green again, and put an end to
today's silliness.

src/backend/tcop/postgres.c
src/backend/utils/init/postinit.c

index e3a4db5de248de378c2cd988dc9c44c662a79fe6..937191334fc558ffaff225bda242a9b323e8683a 100644 (file)
@@ -3653,6 +3653,11 @@ PostgresMain(int argc, char *argv[], const char *username)
         * Create lockfile for data directory.
         */
        CreateDataDirLockFile(false);
+
+       /* In EXEC_BACKEND, this was set via BackendParameters */
+#ifndef EXEC_BACKEND
+       InitializeMaxBackends();
+#endif
    }
 
    /* Early initialization */
index 3948eac039b32fc17b93acbe043bcf757221d131..ddd79d0aa2dfb24ba7cb2f00c1b83fc6c4c5de69 100644 (file)
@@ -453,8 +453,6 @@ InitializeMaxBackends(void)
 void
 BaseInit(void)
 {
-   InitializeMaxBackends();
-
    /*
     * Attach to shared memory and semaphores, and initialize our
     * input/output/debugging file descriptors.