Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/rumentrypage.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ entryPlaceToPage(RumBtree btree, Page page, OffsetNumber off)

entryPreparePage(btree, page, off);

#if PG_VERSION_NUM >= 190000
placed = PageAddItem(page, btree->entry, IndexTupleSize(btree->entry), off, false, false);
#else
placed = PageAddItem(page, (Item) btree->entry, IndexTupleSize(btree->entry), off, false, false);
#endif
if (placed != off)
elog(ERROR, "failed to add item to index page in \"%s\"",
RelationGetRelationName(btree->index));
Expand Down Expand Up @@ -490,7 +494,11 @@ entrySplitPage(RumBtree btree, Buffer lbuf, Buffer rbuf,
lsize += MAXALIGN(IndexTupleSize(itup)) + sizeof(ItemIdData);
}

#if PG_VERSION_NUM >= 190000
if (PageAddItem(page, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#else
if (PageAddItem(page, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#endif
elog(ERROR, "failed to add item to index page in \"%s\"",
RelationGetRelationName(btree->index));
ptr += MAXALIGN(IndexTupleSize(itup));
Expand Down Expand Up @@ -530,12 +538,20 @@ rumEntryFillRoot(RumBtree btree, Buffer root, Buffer lbuf, Buffer rbuf,
IndexTuple itup;

itup = rumPageGetLinkItup(btree, lbuf, lpage);
#if PG_VERSION_NUM >= 190000
if (PageAddItem(page, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#else
if (PageAddItem(page, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#endif
elog(ERROR, "failed to add item to index root page");
pfree(itup);

itup = rumPageGetLinkItup(btree, rbuf, rpage);
#if PG_VERSION_NUM >= 190000
if (PageAddItem(page, itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#else
if (PageAddItem(page, (Item) itup, IndexTupleSize(itup), InvalidOffsetNumber, false, false) == InvalidOffsetNumber)
#endif
elog(ERROR, "failed to add item to index root page");
pfree(itup);
}
Expand Down
4 changes: 3 additions & 1 deletion src/rumtidbitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* you need to transfer the src/backend/nodes/tidbitmap.c of the
* required version to the RUM and include it here.
*/
#if PG_VERSION_NUM >= 180000
#if PG_VERSION_NUM >= 190000
#include "tidbitmap/tidbitmap19.c"
#elif PG_VERSION_NUM >= 180000
#include "tidbitmap/tidbitmap18.c"
#elif PG_VERSION_NUM >= 170000
#include "tidbitmap/tidbitmap17.c"
Expand Down
4 changes: 4 additions & 0 deletions src/rumvacuum.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,11 @@ rumVacuumEntryPage(RumVacuumState * gvs, Buffer buffer, BlockNumber *roots, Offs
pfree(cleaned);
PageIndexTupleDelete(tmppage, i);

#if PG_VERSION_NUM >= 190000
if (PageAddItem(tmppage, itup, IndexTupleSize(itup), i, false, false) != i)
#else
if (PageAddItem(tmppage, (Item) itup, IndexTupleSize(itup), i, false, false) != i)
#endif
elog(ERROR, "failed to add item to index page in \"%s\"",
RelationGetRelationName(gvs->index));

Expand Down
Loading