From: Tom Lane Date: Thu, 6 Feb 2014 16:28:13 +0000 (-0500) Subject: Assert(IsTransactionState()) in RelationIdGetRelation(). X-Git-Tag: REL9_4_BETA1~527 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddfc9cb054abed4d08cc2709c9b2197dab96f449;p=postgresql Assert(IsTransactionState()) in RelationIdGetRelation(). Commit 42c80c696e9c8323841180029cc62741c21bd356 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. --- diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 2a46cfcff7..d47d2d37fc 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1578,6 +1578,9 @@ RelationIdGetRelation(Oid relationId) { Relation rd; + /* Make sure we're in an xact, even if this ends up being a cache hit */ + Assert(IsTransactionState()); + /* * first try to find reldesc in the cache */