diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-02-06 11:28:13 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-02-06 11:28:13 -0500 |
commit | ddfc9cb054abed4d08cc2709c9b2197dab96f449 (patch) | |
tree | 98d56dd294a04a0ed7ef9f28734e769b35f1bf41 /src/backend/utils/cache/relcache.c | |
parent | f31005e340c55948df6ab64370ce5cf202935f89 (diff) | |
download | postgresql-ddfc9cb054abed4d08cc2709c9b2197dab96f449.tar.gz postgresql-ddfc9cb054abed4d08cc2709c9b2197dab96f449.zip |
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.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 2a46cfcff71..d47d2d37fcb 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 */ |