Make standalone backends ignore pg_database.datallowconn, so that there
authorTom Lane <[email protected]>
Thu, 5 May 2005 19:54:13 +0000 (19:54 +0000)
committerTom Lane <[email protected]>
Thu, 5 May 2005 19:54:13 +0000 (19:54 +0000)
is a way to recover from disabling connections to all databases at once.

src/backend/utils/init/postinit.c

index 44b9fe6956a9c20b737083ba0e4035c2750b0549..40ca16430f46a346a28966410da4a6bf9de3301e 100644 (file)
@@ -113,9 +113,11 @@ ReverifyMyDatabase(const char *name)
 
        /*
         * Also check that the database is currently allowing connections.
+        * (We do not enforce this in standalone mode, however, so that there is
+        * a way to recover from "UPDATE pg_database SET datallowconn = false;")
         */
        dbform = (Form_pg_database) GETSTRUCT(tup);
-       if (!dbform->datallowconn)
+       if (IsUnderPostmaster && !dbform->datallowconn)
                elog(FATAL, "Database \"%s\" is not currently accepting connections",
                         name);