summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2005-05-05 19:53:49 +0000
committerTom Lane2005-05-05 19:53:49 +0000
commitd9088d30713d4dcb970d94d7556d47c2e81a6854 (patch)
tree8efd553d64b7b591f35e124463416c1ff297bd12
parent60674033262b69bb7f6da8bdf40df51ccda00e0f (diff)
Make standalone backends ignore pg_database.datallowconn, so that there
is a way to recover from disabling connections to all databases at once.
-rw-r--r--src/backend/utils/init/postinit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 85bfc93c8bc..5def938a9d6 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.127 2003/09/25 06:58:05 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.127.2.1 2005/05/05 19:53:49 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -119,9 +119,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)
ereport(FATAL,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("database \"%s\" is not currently accepting connections",