Skip to content

Commit 6def564

Browse files
author
Mikhail Gribkov
committed
Forbid accessing other sessions temp tables
1 parent c166454 commit 6def564

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/backend/access/common/relation.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ relation_open(Oid relationId, LOCKMODE lockmode)
6060
if (!RelationIsValid(r))
6161
elog(ERROR, "could not open relation with OID %u", relationId);
6262

63+
if (RELATION_IS_OTHER_TEMP(r))
64+
ereport(ERROR,
65+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
66+
errmsg("cannot access temporary tables of other sessions")));
67+
6368
/*
6469
* If we didn't get the lock ourselves, assert that caller holds one,
6570
* except in bootstrap mode where no locks are used.

0 commit comments

Comments
 (0)