From 13752743bf7010f7cbf07bdf2a0087c3960121c5 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Wed, 1 Feb 2017 17:52:35 -0500 Subject: Don't count background workers against a user's connection limit. Doing so doesn't seem to be within the purpose of the per user connection limits, and has particularly unfortunate effects in conjunction with parallel queries. Backpatch to 9.6 where parallel queries were introduced. David Rowley, reviewed by Robert Haas and Albe Laurenz. --- src/backend/utils/init/postinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/init/postinit.c') diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 824d5abf11f..cde4a798b62 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -350,7 +350,7 @@ CheckMyDatabase(const char *name, bool am_superuser) */ if (dbform->datconnlimit >= 0 && !am_superuser && - CountDBBackends(MyDatabaseId) > dbform->datconnlimit) + CountDBConnections(MyDatabaseId) > dbform->datconnlimit) ereport(FATAL, (errcode(ERRCODE_TOO_MANY_CONNECTIONS), errmsg("too many connections for database \"%s\"", -- cgit v1.2.3