From 77fe2b6d795f3f4ed282c9c980920e128a57624e Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 22 Apr 2014 15:34:54 +0300 Subject: [PATCH] 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. --- src/backend/access/nbtree/nbtpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 87ac5f4aaf..b95c1b886d 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -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); -- 2.40.0