Re: [PATCH] Fix: Partitioned parent index remains invalid after child indexes are repaired
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Sami Imseih <samimseih@gmail.com>
Cc: Haibo Yan <tristan.yim@gmail.com>, Mohamed ALi <moali.pg@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-04-14T16:05:38Z
Lists: pgsql-hackers
On Tue, Apr 14, 2026 at 07:18:33AM +0900, Michael Paquier wrote: > On Sat, Apr 11, 2026 at 11:10:54AM -0500, Sami Imseih wrote: >> Would the right solution here be to try to have the ATTACH PARTITION check if >> the parent index is not valid, then validatePartitionedIndex() ? > > This may be a backpatchable thing, even if it requires one to detach > one partition before attaching it again, or attach a fake partition to > force a flip of the flag, before detaching this fake partition. Actually no. Yesterday I was looking at that from the angle of using ALTER TABLE for the job, that requires a partition bound. Sami has mentioned me that a repeated ALTER INDEX .. ATTACH PARTITION does not fail when repeated, so we could just rely on that and enforce a round of indisvalid across the partitioned index we are working on. Could you write a patch? It would be better to have tests with multiple levels, at least, with a partitioned table being a leaf of another partitioned table. I am sure you get the picture, the point being to recurse across multiple levels. -- Michael
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
doc: Mention validation attempt during ALTER INDEX .. ATTACH PARTITION
- d36a668f5d79 14.23 landed
- e4f035de455e 15.18 landed
- 8f2429ff24fe 16.14 landed
- 1f0a58a0c212 17.10 landed
- 7a24fad3d9f3 18.4 landed
- 0916282a0606 19 (unreleased) landed
-
Allow ALTER INDEX .. ATTACH PARTITION to validate a parent index
- d809b16d1bd2 14.23 landed
- 0859000d0d71 15.18 landed
- 313355d68016 16.14 landed
- becf6d26961a 17.10 landed
- 5713ac248f26 18.4 landed
- 9d3e094f12cc 19 (unreleased) landed