*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.147 2007/01/05 22:19:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.148 2007/01/27 20:53:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* need to try it both ways! */
_bt_checksplitloc(&state, offnum, leftfree, rightfree,
true, itemsz);
- /* here we are contemplating newitem as first on right */
+ /*
+ * Here we are contemplating newitem as first on right. In this
+ * case it, not the current item, will become the high key of the
+ * left page, and so we have to correct the allowance made above.
+ */
+ leftfree += (int) itemsz - (int) newitemsz;
_bt_checksplitloc(&state, offnum, leftfree, rightfree,
false, newitemsz);
}