summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/tuptable.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
index 6133dbcd0a3..b82655e7e55 100644
--- a/src/include/executor/tuptable.h
+++ b/src/include/executor/tuptable.h
@@ -167,6 +167,12 @@ struct TupleTableSlotOps
Datum (*getsysattr) (TupleTableSlot *slot, int attnum, bool *isnull);
/*
+ * Check if the tuple is created by the current transaction. Throws an
+ * error if the slot doesn't contain the storage tuple.
+ */
+ bool (*is_current_xact_tuple) (TupleTableSlot *slot);
+
+ /*
* Make the contents of the slot solely depend on the slot, and not on
* underlying resources (like another memory context, buffers, etc).
*/
@@ -427,6 +433,21 @@ slot_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
}
/*
+ * slot_is_current_xact_tuple - check if the slot's current tuple is created
+ * by the current transaction.
+ *
+ * If the slot does not contain a storage tuple, this will throw an error.
+ * Hence before calling this function, callers should make sure that the
+ * slot type supports storage tuples and that there is currently one inside
+ * the slot.
+ */
+static inline bool
+slot_is_current_xact_tuple(TupleTableSlot *slot)
+{
+ return slot->tts_ops->is_current_xact_tuple(slot);
+}
+
+/*
* ExecClearTuple - clear the slot's contents
*/
static inline TupleTableSlot *