rootTuple = *heapTuple;
offnum = ItemPointerGetOffsetNumber(&heapTuple->t_self);
- Assert(OffsetNumberIsValid(root_offsets[offnum - 1]));
+ if (!OffsetNumberIsValid(root_offsets[offnum - 1]))
+ elog(ERROR, "failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
+ ItemPointerGetBlockNumber(&heapTuple->t_self),
+ offnum, RelationGetRelationName(heapRelation));
ItemPointerSetOffsetNumber(&rootTuple.t_self,
root_offsets[offnum - 1]);
if (HeapTupleIsHeapOnly(heapTuple))
{
root_offnum = root_offsets[root_offnum - 1];
- Assert(OffsetNumberIsValid(root_offnum));
+ if (!OffsetNumberIsValid(root_offnum))
+ elog(ERROR, "failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
+ ItemPointerGetBlockNumber(heapcursor),
+ ItemPointerGetOffsetNumber(heapcursor),
+ RelationGetRelationName(heapRelation));
ItemPointerSetOffsetNumber(&rootTuple, root_offnum);
}