index 52b612b15a1cec78fa39e3f79399d4bc6e169b54..a70c7542c92d624114beeae6499a5db2abb7bb2d 100644 (file)
#include "postgres.h"
+#include "miscadmin.h"
#include "access/htup_details.h"
#include "access/xact.h"
#include "utils/combocid.h"
CommandId cid = HeapTupleHeaderGetRawCommandId(tup);
Assert(!(tup->t_infomask & HEAP_MOVED));
- Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tup)));
+ /*
+ * Because GetUpdateXid() performs memory allocations if xmax is a
+ * multixact we can't Assert() if we're inside a critical section. This
+ * weakens the check, but not using GetCmax() inside one would complicate
+ * things too much.
+ */
+ Assert(CritSectionCount > 0 ||
+ TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetUpdateXid(tup)));
if (tup->t_infomask & HEAP_COMBOCID)
return GetRealCmax(cid);