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-19T22:07:59Z
Lists: pgsql-hackers
On Sat, Apr 18, 2026 at 09:37:48AM -0500, Sami Imseih wrote: > Here is the patch with tests. It adds a test for this case using > multi-level partitions and ensures that the parent indexes are > validated once a child index is set to valid. Also, I added the > negative case where only one child index is validated to ensure > that the parent indexes remain invalid. That looks sensible here, including the test coverage. Thanks for the patch! One thing that I'm tempted to add is more scans to check indisvalid across these commands, particularly after the individual ATTACH PARTITION bits on each individual index. A second thing. Do you think that it would be worth adding a partitioned table that has no leaves in some portion of the test? I was thinking about a partitioned table called idxpart2 attached to idxpart in the first part of the test. I've found this pattern usually useful for this area of the code when recursing with validatePartitionedIndex() from a parent. I was also thinking about a partitioned table idxpart3 in the last test block, but as you want to check that indisvalid is not flipped to true for the parent if a child is !indisvalid, it would not be adapted. -- 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