*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.162 2007/11/16 19:53:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.163 2007/12/31 04:52:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (!P_IGNORE(opaque))
break;
if (P_RIGHTMOST(opaque))
- elog(ERROR, "fell off the end of \"%s\"",
+ elog(ERROR, "fell off the end of index \"%s\"",
RelationGetRelationName(rel));
}
maxoff = PageGetMaxOffsetNumber(page);
if (!P_IGNORE(lpageop))
break;
if (P_RIGHTMOST(lpageop))
- elog(ERROR, "fell off the end of \"%s\"",
+ elog(ERROR, "fell off the end of index \"%s\"",
RelationGetRelationName(rel));
}
_bt_relbuf(rel, buf);
item = (IndexTuple) PageGetItem(origpage, itemid);
if (PageAddItem(rightpage, (Item) item, itemsz, rightoff,
false, false) == InvalidOffsetNumber)
- elog(PANIC, "failed to add hikey to the right sibling");
+ elog(PANIC, "failed to add hikey to the right sibling"
+ " while splitting block %u of index \"%s\"",
+ BufferGetBlockNumber(buf), RelationGetRelationName(rel));
rightoff = OffsetNumberNext(rightoff);
}
}
if (PageAddItem(leftpage, (Item) item, itemsz, leftoff,
false, false) == InvalidOffsetNumber)
- elog(PANIC, "failed to add hikey to the left sibling");
+ elog(PANIC, "failed to add hikey to the left sibling"
+ " while splitting block %u of index \"%s\"",
+ BufferGetBlockNumber(buf), RelationGetRelationName(rel));
leftoff = OffsetNumberNext(leftoff);
/*
spage = BufferGetPage(sbuf);
sopaque = (BTPageOpaque) PageGetSpecialPointer(spage);
if (sopaque->btpo_prev != ropaque->btpo_prev)
- elog(PANIC, "right sibling's left-link doesn't match");
+ elog(PANIC, "right sibling's left-link doesn't match: "
+ "block %u links to %u instead of expected %u in index \"%s\"",
+ ropaque->btpo_next, sopaque->btpo_prev, ropaque->btpo_prev,
+ RelationGetRelationName(rel));
/*
* Check to see if we can set the SPLIT_END flag in the right-hand
* in case ...
*/
if (!state.have_split)
- elog(ERROR, "could not find a feasible split point for \"%s\"",
+ elog(ERROR, "could not find a feasible split point for index \"%s\"",
RelationGetRelationName(rel));
*newitemonleft = state.newitemonleft;
/* Check for error only after writing children */
if (pbuf == InvalidBuffer)
- elog(ERROR, "failed to re-find parent key in \"%s\" for split pages %u/%u",
+ elog(ERROR, "failed to re-find parent key in index \"%s\" for split pages %u/%u",
RelationGetRelationName(rel), bknum, rbknum);
/* Recursively update the parent */
*/
if (PageAddItem(rootpage, (Item) new_item, itemsz, P_HIKEY,
false, false) == InvalidOffsetNumber)
- elog(PANIC, "failed to add leftkey to new root page");
+ elog(PANIC, "failed to add leftkey to new root page"
+ " while splitting block %u of index \"%s\"",
+ BufferGetBlockNumber(lbuf), RelationGetRelationName(rel));
pfree(new_item);
/*
*/
if (PageAddItem(rootpage, (Item) new_item, itemsz, P_FIRSTKEY,
false, false) == InvalidOffsetNumber)
- elog(PANIC, "failed to add rightkey to new root page");
+ elog(PANIC, "failed to add rightkey to new root page"
+ " while splitting block %u of index \"%s\"",
+ BufferGetBlockNumber(lbuf), RelationGetRelationName(rel));
pfree(new_item);
MarkBufferDirty(rootbuf);
if (PageAddItem(page, (Item) itup, itemsize, itup_off,
false, false) == InvalidOffsetNumber)
- elog(PANIC, "failed to add item to the %s for \"%s\"",
+ elog(PANIC, "failed to add item to the %s in index \"%s\"",
where, RelationGetRelationName(rel));
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.104 2007/11/15 21:14:32 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.105 2007/12/31 04:52:05 tgl Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
/* it's dead, Jim. step right one page */
if (P_RIGHTMOST(rootopaque))
- elog(ERROR, "no live root page found in \"%s\"",
+ elog(ERROR, "no live root page found in index \"%s\"",
RelationGetRelationName(rel));
rootblkno = rootopaque->btpo_next;
}
/* Note: can't check btpo.level on deleted pages */
if (rootopaque->btpo.level != rootlevel)
- elog(ERROR, "root page %u of \"%s\" has level %u, expected %u",
+ elog(ERROR, "root page %u of index \"%s\" has level %u, expected %u",
rootblkno, RelationGetRelationName(rel),
rootopaque->btpo.level, rootlevel);
}
/* it's dead, Jim. step right one page */
if (P_RIGHTMOST(rootopaque))
- elog(ERROR, "no live root page found in \"%s\"",
+ elog(ERROR, "no live root page found in index \"%s\"",
RelationGetRelationName(rel));
rootblkno = rootopaque->btpo_next;
}
/* Note: can't check btpo.level on deleted pages */
if (rootopaque->btpo.level != rootlevel)
- elog(ERROR, "root page %u of \"%s\" has level %u, expected %u",
+ elog(ERROR, "root page %u of index \"%s\" has level %u, expected %u",
rootblkno, RelationGetRelationName(rel),
rootopaque->btpo.level, rootlevel);
ItemPointerSet(&(stack->bts_btentry.t_tid), target, P_HIKEY);
pbuf = _bt_getstackbuf(rel, stack, BT_READ);
if (pbuf == InvalidBuffer)
- elog(ERROR, "failed to re-find parent key in \"%s\" for deletion target page %u",
+ elog(ERROR, "failed to re-find parent key in index \"%s\" for deletion target page %u",
RelationGetRelationName(rel), target);
parent = stack->bts_blkno;
poffset = stack->bts_offset;
return 0;
}
if (opaque->btpo_prev != leftsib)
- elog(ERROR, "left link changed unexpectedly in block %u of \"%s\"",
+ elog(ERROR, "left link changed unexpectedly in block %u of index \"%s\"",
target, RelationGetRelationName(rel));
/*
ItemPointerSet(&(stack->bts_btentry.t_tid), target, P_HIKEY);
pbuf = _bt_getstackbuf(rel, stack, BT_WRITE);
if (pbuf == InvalidBuffer)
- elog(ERROR, "failed to re-find parent key in \"%s\" for deletion target page %u",
+ elog(ERROR, "failed to re-find parent key in index \"%s\" for deletion target page %u",
RelationGetRelationName(rel), target);
parent = stack->bts_blkno;
poffset = stack->bts_offset;
if (poffset == P_FIRSTDATAKEY(opaque))
parent_half_dead = true;
else
- elog(ERROR, "failed to delete rightmost child %u of %u in \"%s\"",
+ elog(ERROR, "failed to delete rightmost child %u of block %u in index \"%s\"",
target, parent, RelationGetRelationName(rel));
}
else
itemid = PageGetItemId(page, nextoffset);
itup = (IndexTuple) PageGetItem(page, itemid);
if (ItemPointerGetBlockNumber(&(itup->t_tid)) != rightsib)
- elog(PANIC, "right sibling is not next child in \"%s\"",
+ elog(PANIC, "right sibling %u of block %u is not next child of %u in index \"%s\"",
+ rightsib, target, BufferGetBlockNumber(pbuf),
RelationGetRelationName(rel));
PageIndexTupleDelete(page, nextoffset);
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.114 2007/11/15 21:14:32 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsearch.c,v 1.115 2007/12/31 04:52:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
if (P_IGNORE(opaque))
- elog(ERROR, "fell off the end of \"%s\"",
+ elog(ERROR, "fell off the end of index \"%s\"",
RelationGetRelationName(rel));
return buf;
for (;;)
{
if (P_RIGHTMOST(opaque))
- elog(ERROR, "fell off the end of \"%s\"",
+ elog(ERROR, "fell off the end of index \"%s\"",
RelationGetRelationName(rel));
blkno = opaque->btpo_next;
buf = _bt_relandgetbuf(rel, buf, blkno, BT_READ);
* into an infinite loop if there's anything wrong.
*/
if (opaque->btpo_prev == lblkno)
- elog(ERROR, "could not find left sibling in \"%s\"",
- RelationGetRelationName(rel));
+ elog(ERROR, "could not find left sibling of block %u in index \"%s\"",
+ obknum, RelationGetRelationName(rel));
/* Okay to try again with new lblkno value */
}
}
{
blkno = opaque->btpo_next;
if (blkno == P_NONE)
- elog(ERROR, "fell off the end of \"%s\"",
+ elog(ERROR, "fell off the end of index \"%s\"",
RelationGetRelationName(rel));
buf = _bt_relandgetbuf(rel, buf, blkno, BT_READ);
page = BufferGetPage(buf);
if (opaque->btpo.level == level)
break;
if (opaque->btpo.level < level)
- elog(ERROR, "btree level %u not found", level);
+ elog(ERROR, "btree level %u not found in index \"%s\"",
+ level, RelationGetRelationName(rel));
/* Descend to leftmost or rightmost child page */
if (rightmost)