Fix bug in new B-tree page deletion code.

When modifying a page, must hold an exclusive lock. A shared lock is
obviously not good enough.
This commit is contained in:
Heikki Linnakangas 2014-04-22 15:34:54 +03:00
parent 7e30c186da
commit 77fe2b6d79
1 changed files with 1 additions and 1 deletions

View File

@ -996,7 +996,7 @@ _bt_lock_branch_parent(Relation rel, BlockNumber child, BTStack stack,
/* Locate the parent's downlink (updating the stack entry if needed) */
ItemPointerSet(&(stack->bts_btentry.t_tid), child, P_HIKEY);
pbuf = _bt_getstackbuf(rel, stack, BT_READ);
pbuf = _bt_getstackbuf(rel, stack, BT_WRITE);
if (pbuf == InvalidBuffer)
elog(ERROR, "failed to re-find parent key in index \"%s\" for deletion target page %u",
RelationGetRelationName(rel), child);