aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/cache/catcache.c4
1 files changed, 4 insertions, 0 deletions
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
*/