aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/heap/heapam.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 99a431a95ff..c910863e273 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -2291,6 +2291,14 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
CacheInvalidateHeapTuple(relation, heaptuples[i], NULL);
}
+ /*
+ * Copy t_self fields back to the caller's original tuples. This does
+ * nothing for untoasted tuples (tuples[i] == heaptuples[i)], but it's
+ * probably faster to always copy than check.
+ */
+ for (i = 0; i < ntuples; i++)
+ tuples[i]->t_self = heaptuples[i]->t_self;
+
pgstat_count_heap_insert(relation, ntuples);
}