summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2017-02-01 17:52:35 -0500
committerAndrew Dunstan <andrew@dunslane.net>2017-02-01 17:59:53 -0500
commit13752743bf7010f7cbf07bdf2a0087c3960121c5 (patch)
treed0e44e9805b08ad31cbf6e8f295eb25fcf4cb23a /src/include
parenteb5e9d90df7536d0cf5c0d669d874f91b7be36d6 (diff)
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.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/proc.h2
-rw-r--r--src/include/storage/procarray.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index 775c66a1971..c44d82b90c0 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -102,6 +102,8 @@ struct PGPROC
Oid databaseId; /* OID of database this backend is using */
Oid roleId; /* OID of role using this backend */
+ bool isBackgroundWorker; /* true if background worker. */
+
/*
* While in hot standby mode, shows that a conflict signal has been sent
* for the current transaction. Set/cleared while holding ProcArrayLock,
diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h
index dd37c0cb070..ecc3c4a4f63 100644
--- a/src/include/storage/procarray.h
+++ b/src/include/storage/procarray.h
@@ -73,6 +73,7 @@ extern pid_t CancelVirtualTransaction(VirtualTransactionId vxid, ProcSignalReaso
extern bool MinimumActiveBackends(int min);
extern int CountDBBackends(Oid databaseid);
+extern int CountDBConnections(Oid databaseid);
extern void CancelDBBackends(Oid databaseid, ProcSignalReason sigmode, bool conflictPending);
extern int CountUserBackends(Oid roleid);
extern bool CountOtherDBBackends(Oid databaseId,