aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2013-07-15 13:31:36 -0400
committerRobert Haas <rhaas@postgresql.org>2013-07-15 13:31:36 -0400
commit42c80c696e9c8323841180029cc62741c21bd356 (patch)
tree4f1176ef2eec3aa8b90dba7ceb4c9bea8ed9b5d4 /src
parentac33c7e2c1304dffcf107065d7fc04232a8a94fa (diff)
downloadpostgresql-42c80c696e9c8323841180029cc62741c21bd356.tar.gz
postgresql-42c80c696e9c8323841180029cc62741c21bd356.zip
Assert that syscache lookups don't happen outside transactions.
Andres Freund
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
*/