Skip to content

Commit 77fe2b6

Browse files
committed
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.
1 parent 7e30c18 commit 77fe2b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/nbtree/nbtpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ _bt_lock_branch_parent(Relation rel, BlockNumber child, BTStack stack,
996996

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy