Commits

Anonymous committed 42c80c6

Assert that syscache lookups don't happen outside transactions.

Andres Freund

  • Participants
  • Parent commits ac33c7e

Comments (0)

Files changed (1)

src/backend/utils/cache/catcache.c

 #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"
 	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
 	 */