aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-04-22 15:34:54 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-04-22 15:34:54 +0300
commit77fe2b6d795f3f4ed282c9c980920e128a57624e (patch)
tree41b45ca0fd021e0cd661d991b49744e544b17a17 /src
parent7e30c186da8eaae84ab30352ac23f0d5bdc59e25 (diff)
downloadpostgresql-77fe2b6d795f3f4ed282c9c980920e128a57624e.tar.gz
postgresql-77fe2b6d795f3f4ed282c9c980920e128a57624e.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/nbtree/nbtpage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c
index 87ac5f4aafb..b95c1b886d4 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);