Skip to content

Commit

Permalink
Assert(IsTransactionState()) in RelationIdGetRelation().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tglsfdc committed Feb 6, 2014
1 parent f31005e commit ddfc9cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/backend/utils/cache/relcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit ddfc9cb

Please sign in to comment.