aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-05 19:53:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-05 19:53:26 +0000
commitc2e729fa207e5a20d0038c12170cc71b9d4abd34 (patch)
tree98ee44a0d9fccbfff4853643cd78393d4af2886c /src/backend/utils/init/postinit.c
parent64c8635a4de921fcf60068f746936ecdf24b27be (diff)
downloadpostgresql-c2e729fa207e5a20d0038c12170cc71b9d4abd34.tar.gz
postgresql-c2e729fa207e5a20d0038c12170cc71b9d4abd34.zip
Make standalone backends ignore pg_database.datallowconn, so that there
is a way to recover from disabling connections to all databases at once.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-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 2030106f970..fef1565a04b 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.145 2005/04/14 20:03:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.146 2005/05/05 19:53:26 tgl Exp $
*
*
*-------------------------------------------------------------------------
@@ -165,9 +165,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",