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

Commit0c23771

Browse files
committed
DETACH PARTITION: hold locks on indexes until end of transaction
When a partition is detached from its parent, we acquire locks on allattached indexes to also detach them ... but we release those locksimmediately. This is a violation of the policy of keeping locks on userobjects to the end of the transaction. Bug introduced in8b08f7d.It's unclear that there are any ill effects possible, but it's clearlywrong nonetheless. It's likely that bad behavior *is* possible, butmostly because the relation that the index is for is only locked withAccessShareLock, which is an older bug that shall be fixed separately.While touching that line of code, close the index opened withindex_open() using index_close() instead of relation_close().No difference in practice, but let's be consistent.Unearthed by Robert Haas.Discussion:https://postgr.es/m/CA+TgmoYruJQ+2qnFLtF1xQtr71pdwgfxy3Ziy-TxV28M6pEmyA@mail.gmail.com
1 parent4cba9c2 commit0c23771

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
@@ -14648,7 +14648,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
1464814648
idx=index_open(idxid,AccessExclusiveLock);
1464914649
IndexSetParentIndex(idx,InvalidOid);
1465014650
update_relispartition(classRel,idxid, false);
14651-
relation_close(idx,AccessExclusiveLock);
14651+
index_close(idx,NoLock);
1465214652
}
1465314653
heap_close(classRel,RowExclusiveLock);
1465414654

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp