From aae50236e4ce95c05a3962be0814c74c5a22206d Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Fri, 8 Nov 2019 00:44:52 -0800 Subject: 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 --- contrib/bloom/blinsert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/bloom') diff --git a/contrib/bloom/blinsert.c b/contrib/bloom/blinsert.c index 30d17f501d..adcbd168fb 100644 --- a/contrib/bloom/blinsert.c +++ b/contrib/bloom/blinsert.c @@ -72,7 +72,7 @@ initCachedPage(BloomBuildState *buildstate) * Per-tuple callback for table_index_build_scan. */ static void -bloomBuildCallback(Relation index, HeapTuple htup, Datum *values, +bloomBuildCallback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state) { BloomBuildState *buildstate = (BloomBuildState *) state; @@ -81,7 +81,7 @@ bloomBuildCallback(Relation index, HeapTuple htup, Datum *values, oldCtx = MemoryContextSwitchTo(buildstate->tmpCtx); - itup = BloomFormTuple(&buildstate->blstate, &htup->t_self, values, isnull); + itup = BloomFormTuple(&buildstate->blstate, tid, values, isnull); /* Try to add next item to cached page */ if (BloomPageAddItem(&buildstate->blstate, buildstate->data.data, itup)) -- cgit v1.2.3