8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.162 2007/11/16 19:53:50 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.163 2007/12/31 04:52:05 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -338,7 +338,7 @@ _bt_check_unique(Relation rel, IndexTuple itup, Relation heapRel,
338
338
if (!P_IGNORE (opaque ))
339
339
break ;
340
340
if (P_RIGHTMOST (opaque ))
341
- elog (ERROR , "fell off the end of \"%s\"" ,
341
+ elog (ERROR , "fell off the end of index \"%s\"" ,
342
342
RelationGetRelationName (rel ));
343
343
}
344
344
maxoff = PageGetMaxOffsetNumber (page );
@@ -492,7 +492,7 @@ _bt_findinsertloc(Relation rel,
492
492
if (!P_IGNORE (lpageop ))
493
493
break ;
494
494
if (P_RIGHTMOST (lpageop ))
495
- elog (ERROR , "fell off the end of \"%s\"" ,
495
+ elog (ERROR , "fell off the end of index \"%s\"" ,
496
496
RelationGetRelationName (rel ));
497
497
}
498
498
_bt_relbuf (rel , buf );
@@ -840,7 +840,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
840
840
item = (IndexTuple ) PageGetItem (origpage , itemid );
841
841
if (PageAddItem (rightpage , (Item ) item , itemsz , rightoff ,
842
842
false, false) == InvalidOffsetNumber )
843
- elog (PANIC , "failed to add hikey to the right sibling" );
843
+ elog (PANIC , "failed to add hikey to the right sibling"
844
+ " while splitting block %u of index \"%s\"" ,
845
+ BufferGetBlockNumber (buf ), RelationGetRelationName (rel ));
844
846
rightoff = OffsetNumberNext (rightoff );
845
847
}
846
848
@@ -865,7 +867,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
865
867
}
866
868
if (PageAddItem (leftpage , (Item ) item , itemsz , leftoff ,
867
869
false, false) == InvalidOffsetNumber )
868
- elog (PANIC , "failed to add hikey to the left sibling" );
870
+ elog (PANIC , "failed to add hikey to the left sibling"
871
+ " while splitting block %u of index \"%s\"" ,
872
+ BufferGetBlockNumber (buf ), RelationGetRelationName (rel ));
869
873
leftoff = OffsetNumberNext (leftoff );
870
874
871
875
/*
@@ -942,7 +946,10 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
942
946
spage = BufferGetPage (sbuf );
943
947
sopaque = (BTPageOpaque ) PageGetSpecialPointer (spage );
944
948
if (sopaque -> btpo_prev != ropaque -> btpo_prev )
945
- elog (PANIC , "right sibling's left-link doesn't match" );
949
+ elog (PANIC , "right sibling's left-link doesn't match: "
950
+ "block %u links to %u instead of expected %u in index \"%s\"" ,
951
+ ropaque -> btpo_next , sopaque -> btpo_prev , ropaque -> btpo_prev ,
952
+ RelationGetRelationName (rel ));
946
953
947
954
/*
948
955
* Check to see if we can set the SPLIT_END flag in the right-hand
@@ -1305,7 +1312,7 @@ _bt_findsplitloc(Relation rel,
1305
1312
* in case ...
1306
1313
*/
1307
1314
if (!state .have_split )
1308
- elog (ERROR , "could not find a feasible split point for \"%s\"" ,
1315
+ elog (ERROR , "could not find a feasible split point for index \"%s\"" ,
1309
1316
RelationGetRelationName (rel ));
1310
1317
1311
1318
* newitemonleft = state .newitemonleft ;
@@ -1509,7 +1516,7 @@ _bt_insert_parent(Relation rel,
1509
1516
1510
1517
/* Check for error only after writing children */
1511
1518
if (pbuf == InvalidBuffer )
1512
- elog (ERROR , "failed to re-find parent key in \"%s\" for split pages %u/%u" ,
1519
+ elog (ERROR , "failed to re-find parent key in index \"%s\" for split pages %u/%u" ,
1513
1520
RelationGetRelationName (rel ), bknum , rbknum );
1514
1521
1515
1522
/* Recursively update the parent */
@@ -1717,7 +1724,9 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
1717
1724
*/
1718
1725
if (PageAddItem (rootpage , (Item ) new_item , itemsz , P_HIKEY ,
1719
1726
false, false) == InvalidOffsetNumber )
1720
- elog (PANIC , "failed to add leftkey to new root page" );
1727
+ elog (PANIC , "failed to add leftkey to new root page"
1728
+ " while splitting block %u of index \"%s\"" ,
1729
+ BufferGetBlockNumber (lbuf ), RelationGetRelationName (rel ));
1721
1730
pfree (new_item );
1722
1731
1723
1732
/*
@@ -1735,7 +1744,9 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
1735
1744
*/
1736
1745
if (PageAddItem (rootpage , (Item ) new_item , itemsz , P_FIRSTKEY ,
1737
1746
false, false) == InvalidOffsetNumber )
1738
- elog (PANIC , "failed to add rightkey to new root page" );
1747
+ elog (PANIC , "failed to add rightkey to new root page"
1748
+ " while splitting block %u of index \"%s\"" ,
1749
+ BufferGetBlockNumber (lbuf ), RelationGetRelationName (rel ));
1739
1750
pfree (new_item );
1740
1751
1741
1752
MarkBufferDirty (rootbuf );
@@ -1822,7 +1833,7 @@ _bt_pgaddtup(Relation rel,
1822
1833
1823
1834
if (PageAddItem (page , (Item ) itup , itemsize , itup_off ,
1824
1835
false, false) == InvalidOffsetNumber )
1825
- elog (PANIC , "failed to add item to the %s for \"%s\"" ,
1836
+ elog (PANIC , "failed to add item to the %s in index \"%s\"" ,
1826
1837
where , RelationGetRelationName (rel ));
1827
1838
}
1828
1839
0 commit comments