Skip to content

Commit ddfc9cb

Browse files
committed
Assert(IsTransactionState()) in RelationIdGetRelation().
Commit 42c80c6 added an Assert(IsTransactionState()) in SearchCatCache(), to catch any code that thought it could do a catcache lookup outside transactions. Extend the same idea to relcache lookups.
1 parent f31005e commit ddfc9cb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/utils/cache/relcache.c

+3
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,9 @@ RelationIdGetRelation(Oid relationId)
15781578
{
15791579
Relation rd;
15801580

1581+
/* Make sure we're in an xact, even if this ends up being a cache hit */
1582+
Assert(IsTransactionState());
1583+
15811584
/*
15821585
* first try to find reldesc in the cache
15831586
*/

0 commit comments

Comments
 (0)