Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit053ad56

Browse files
committed
Fix lock level used for partition when detaching it
For probably bogus reasons, we acquire only AccessShareLock on thepartition when we try to detach it from its parent partitioned table.This can cause ugly things to happen if another transaction is doingany sort of DDL to the partition concurrently.Upgrade that lock to ShareUpdateExclusiveLock, which per discussionseems to be the minimum needed.Reported by Robert Haas.Discussion:https://postgr.es/m/CA+TgmoYruJQ+2qnFLtF1xQtr71pdwgfxy3Ziy-TxV28M6pEmyA@mail.gmail.com
1 parent4e4c0d6 commit053ad56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14726,7 +14726,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
1472614726
if (OidIsValid(defaultPartOid))
1472714727
LockRelationOid(defaultPartOid,AccessExclusiveLock);
1472814728

14729-
partRel=heap_openrv(name,AccessShareLock);
14729+
partRel=heap_openrv(name,ShareUpdateExclusiveLock);
1473014730

1473114731
/* All inheritance related checks are performed within the function */
1473214732
RemoveInheritance(partRel,rel);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp