aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-01-15 13:58:33 +0900
committerMichael Paquier <michael@paquier.xyz>2020-01-15 13:58:33 +0900
commitac5bdf62617507b1942f6124a2696c04a16fca04 (patch)
tree4b056809d8d4544a76a0a3fd0c4958e470e5fb4f /src
parent4d8a8d0c738410ec02aab46b1ebe1835365ad384 (diff)
downloadpostgresql-ac5bdf62617507b1942f6124a2696c04a16fca04.tar.gz
postgresql-ac5bdf62617507b1942f6124a2696c04a16fca04.zip
Fix buggy logic in isTempNamespaceInUse()
The logic introduced in this routine as of 246a6c8 would report an incorrect result when a session calls it to check if the temporary namespace owned by the session is in use or not. It is possible to optimize more the routine in this case to avoid a PGPROC lookup, but let's keep the logic simple. As this routine is used only by autovacuum for now, there were no live bugs, still let's be correct for any future code involving it. Author: Michael Paquier Reviewed-by: Julien Rouhaud Discussion: https://postgr.es/m/20200113093703.GA41902@paquier.xyz Backpatch-through: 11
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/namespace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index c82f9fc4b52..e70243a0084 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -3235,8 +3235,8 @@ isTempNamespaceInUse(Oid namespaceId)
backendId = GetTempNamespaceBackendId(namespaceId);
- if (backendId == InvalidBackendId ||
- backendId == MyBackendId)
+ /* No such temporary namespace? */
+ if (backendId == InvalidBackendId)
return false;
/* Is the backend alive? */