1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-08 07:21:33 +03:00

Make standalone backends ignore pg_database.datallowconn, so that there

is a way to recover from disabling connections to all databases at once.
This commit is contained in:
Tom Lane 2005-05-05 19:53:26 +00:00
parent 64c8635a4d
commit c2e729fa20

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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. * 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); dbform = (Form_pg_database) GETSTRUCT(tup);
if (!dbform->datallowconn) if (IsUnderPostmaster && !dbform->datallowconn)
ereport(FATAL, ereport(FATAL,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("database \"%s\" is not currently accepting connections", errmsg("database \"%s\" is not currently accepting connections",