]> granicus.if.org Git - postgresql/commitdiff
Assert(IsTransactionState()) in RelationIdGetRelation().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Feb 2014 16:28:13 +0000 (11:28 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Feb 2014 16:28:13 +0000 (11:28 -0500)
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

index 2a46cfcff711ac8b131e4fc0fbf53b45300ef02f..d47d2d37fcb089d210e2457db4d6adf882ccf508 100644 (file)
@@ -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
         */