mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Replace PGPROC.isBackgroundWorker with isRegularBackend.
Commit 34486b609 effectively redefined isBackgroundWorker as meaning
"not a regular backend", whereas before it had the narrower
meaning of AmBackgroundWorkerProcess(). For clarity, rename the
field to isRegularBackend and invert its sense.
Discussion: https://postgr.es/m/1808397.1735156190@sss.pgh.pa.us
This commit is contained in:
@@ -3640,8 +3640,8 @@ CountDBConnections(Oid databaseid)
|
||||
|
||||
if (proc->pid == 0)
|
||||
continue; /* do not count prepared xacts */
|
||||
if (proc->isBackgroundWorker)
|
||||
continue; /* do not count background workers */
|
||||
if (!proc->isRegularBackend)
|
||||
continue; /* count only regular backend processes */
|
||||
if (!OidIsValid(databaseid) ||
|
||||
proc->databaseId == databaseid)
|
||||
count++;
|
||||
@@ -3712,8 +3712,8 @@ CountUserBackends(Oid roleid)
|
||||
|
||||
if (proc->pid == 0)
|
||||
continue; /* do not count prepared xacts */
|
||||
if (proc->isBackgroundWorker)
|
||||
continue; /* do not count background workers */
|
||||
if (!proc->isRegularBackend)
|
||||
continue; /* count only regular backend processes */
|
||||
if (proc->roleId == roleid)
|
||||
count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user