Re: [PATCH] Fix: Partitioned parent index remains invalid after child indexes are repaired

Sami Imseih <samimseih@gmail.com>

From: Sami Imseih <samimseih@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Haibo Yan <tristan.yim@gmail.com>, Mohamed ALi <moali.pg@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-04-18T14:37:48Z
Lists: pgsql-hackers

Attachments

Hi,

> 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.

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.

--
Sami Imseih
Amazon Web Services (AWS)

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. doc: Mention validation attempt during ALTER INDEX .. ATTACH PARTITION

  2. Allow ALTER INDEX .. ATTACH PARTITION to validate a parent index