> On Oct 25, 2026, at 17:32, Álvaro Herrera <[email protected]> wrote:
> 
> On 2026-Sep-03, Kirill Reshke wrote:
> 
>>> Potential issue remaining
>>> ===================
>>> 
>>> Currently, find_all_inheritors() sorts all inheritors purely by OID.
>>> In most cases this works, because users typically create a
>>> partitioned table first and then add partitions later, so the
>>> partitioned table’s OID is smaller than those of its partitions.
> 
> Hmm, I suppose I just added one more possibility for this kind of
> deadlock failure with the 2ebd6849743 fix; maybe we should apply this
> methodology to that code also.
> 
> -- 
> Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
> Are you not unsure you want to delete Firefox?
>       [Not unsure]     [Not not unsure]    [Cancel]
>                   http://smylers.hates-software.com/2008/01/03/566e45b2.html

Thanks for pointing out that, looks like ALTER INDEX ATTACH PARTITION has the 
same deadlock issue.

PFA v5:
* 0001 - just added one line comment based on v4-0001
* 0002 - fixed the ALTER INDEX ATTACH PARTITION by leveraging 0001’s mechanism
* 0003 - based on v4-0002, added a new test for 0002. Without 0002, the test 
will fail

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Attachment: v5-0001-Prevent-deadlock-between-ALTER-TABLE-recursion-an.patch
Description: Binary data

Attachment: v5-0002-Prevent-deadlocks-during-partitioned-index-attach.patch
Description: Binary data

Attachment: v5-0003-Add-isolation-tests-for-ATTACH-PARTITION-lock-ord.patch
Description: Binary data

Reply via email to