postgres.git / summary / log / commit / refs
commit ddfc9cb054abed4d08cc2709c9b2197dab96f449
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Feb 06 16:28:13 2014 +0000
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.
src/backend/utils/cache/relcache.c | 3 +++
1 file changed, 3 insertions(+)
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
*/
[parent: f31005e340c5]