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 --- src/backend/access/gist/gistbuild.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/access/gist/gistbuild.c') diff --git a/src/backend/access/gist/gistbuild.c b/src/backend/access/gist/gistbuild.c index 2f4543dee52..739846a257d 100644 --- a/src/backend/access/gist/gistbuild.c +++ b/src/backend/access/gist/gistbuild.c @@ -80,7 +80,7 @@ typedef struct static void gistInitBuffering(GISTBuildState *buildstate); static int calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep); static void gistBuildCallback(Relation index, - HeapTuple htup, + ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, @@ -440,7 +440,7 @@ calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep) */ static void gistBuildCallback(Relation index, - HeapTuple htup, + ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, @@ -454,7 +454,7 @@ gistBuildCallback(Relation index, /* form an index tuple and point it at the heap tuple */ itup = gistFormTuple(buildstate->giststate, index, values, isnull, true); - itup->t_tid = htup->t_self; + itup->t_tid = *tid; if (buildstate->bufferingMode == GIST_BUFFERING_ACTIVE) { -- cgit v1.2.3