summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/portal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index 7250c9c1bb3..c1d93a96bb4 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -163,6 +163,16 @@ typedef struct PortalData
MemoryContext holdContext; /* memory containing holdStore */
/*
+ * Snapshot under which tuples in the holdStore were read. We must keep a
+ * reference to this snapshot if there is any possibility that the tuples
+ * contain TOAST references, because releasing the snapshot could allow
+ * recently-dead rows to be vacuumed away, along with any toast data
+ * belonging to them. In the case of a held cursor, we avoid needing to
+ * keep such a snapshot by forcibly detoasting the data.
+ */
+ Snapshot holdSnapshot; /* registered snapshot, or NULL if none */
+
+ /*
* atStart, atEnd and portalPos indicate the current cursor position.
* portalPos is zero before the first row, N after fetching N'th row of
* query. After we run off the end, portalPos = # of rows in query, and