aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gin/gininsert.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-11-08 00:44:52 -0800
committerAndres Freund <andres@anarazel.de>2019-11-08 11:49:29 -0800
commitaae50236e4ce95c05a3962be0814c74c5a22206d (patch)
treeab040612da65567def53a6ee17db9b0b54f3037d /src/backend/access/gin/gininsert.c
parent71a8a4f6e36547bb060dbcc961ea9b57420f7190 (diff)
downloadpostgresql-aae50236e4ce95c05a3962be0814c74c5a22206d.tar.gz
postgresql-aae50236e4ce95c05a3962be0814c74c5a22206d.zip
Pass ItemPointer not HeapTuple to IndexBuildCallback.
Not all AMs use HeapTuples internally, making it inconvenient to pass a HeapTuple. As the index callbacks really only need the TID, not the full tuple, modify callback to only take ItemPointer. Author: Ashwin Agrawal Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CALfoeis6=8ehuR=VNtHvj3z16cYfCwPdTcpaxU+sfSUJ5QgR3g@mail.gmail.com
Diffstat (limited to 'src/backend/access/gin/gininsert.c')
-rw-r--r--src/backend/access/gin/gininsert.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c
index 6eb83639aa0..d2905818b26 100644
--- a/src/backend/access/gin/gininsert.c
+++ b/src/backend/access/gin/gininsert.c
@@ -276,7 +276,7 @@ ginHeapTupleBulkInsert(GinBuildState *buildstate, OffsetNumber attnum,
}
static void
-ginBuildCallback(Relation index, HeapTuple htup, Datum *values,
+ginBuildCallback(Relation index, ItemPointer tid, Datum *values,
bool *isnull, bool tupleIsAlive, void *state)
{
GinBuildState *buildstate = (GinBuildState *) state;
@@ -287,8 +287,7 @@ ginBuildCallback(Relation index, HeapTuple htup, Datum *values,
for (i = 0; i < buildstate->ginstate.origTupdesc->natts; i++)
ginHeapTupleBulkInsert(buildstate, (OffsetNumber) (i + 1),
- values[i], isnull[i],
- &htup->t_self);
+ values[i], isnull[i], tid);
/* If we've maxed out our available memory, dump everything to the index */
if (buildstate->accum.allocatedMemory >= (Size) maintenance_work_mem * 1024L)