Re: tablecmds: fix bug where index rebuild loses replica identity on partitions - Mailing list pgsql-hackers

From Alberto Piai
Subject Re: tablecmds: fix bug where index rebuild loses replica identity on partitions
Date
Msg-id DKCPTOUWSN8G.ZOEE18C6M6QE@gmail.com
Whole thread
In response to Re: tablecmds: fix bug where index rebuild loses replica identity on partitions  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Eager aggregation, take 3
List pgsql-hackers
On Tue Jul 28, 2026 at 10:46 AM CEST, Chao Li wrote:
> Thanks for your review and suggestion. I think your analysis is correct, and your suggested direction sounds
reasonable.However, the current ALTER TABLE infra doesn't seem well suited to it. ATPostAlterTypeCleanup() for the
parentcalls performMultipleDeletions(), which also deletes the dependent child partition indexes, while DefineIndex()
forthe parent automatically recreates the parent index and all child indexes. 

Just to wrap up this branch of the thread: I experimented a bit with
"unlinking" the partitions by removing their pg_depend records to
prevent the recursive drop. I agree that going this way would require a
sinificant change – or at least I couldn't see a simple way to make this
happen.

Your approach is better, I will add my review on the latest version of
the patch.


Regards,

Alberto


--
Alberto Piai
Sensational AG
Zürich, Switzerland




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: CREATE SUBSCRIPTION ... SERVER vs. pg_dump, etc.
Next
From: Christoph Berg
Date:
Subject: Re: WAL compression setting after PostgreSQL LZ4 default change