From: Robert Haas Date: Mon, 15 Jul 2013 17:31:36 +0000 (-0400) Subject: Assert that syscache lookups don't happen outside transactions. X-Git-Tag: REL9_4_BETA1~1324 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42c80c696e9c8323841180029cc62741c21bd356;p=thirdparty%2Fpostgresql.git Assert that syscache lookups don't happen outside transactions. Andres Freund --- diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index d12da7615a1..cca0572a5dc 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -21,6 +21,7 @@ #include "access/sysattr.h" #include "access/tuptoaster.h" #include "access/valid.h" +#include "access/xact.h" #include "catalog/pg_operator.h" #include "catalog/pg_type.h" #include "miscadmin.h" @@ -1067,6 +1068,9 @@ SearchCatCache(CatCache *cache, SysScanDesc scandesc; HeapTuple ntp; + /* Make sure we're in a xact, even if this ends up being a cache hit */ + Assert(IsTransactionState()); + /* * one-time startup overhead for each cache */