[PATCH] doc: Document that invalid indexes are skipped during ATTACH PARTITION
Mohamed ALi <moali.pg@gmail.com>
From: Mohamed ALi <moali.pg@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Michael Paquier <michael@paquier.xyz>, Sami Imseih <samimseih@gmail.com>
Date: 2026-05-15T18:30:24Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
doc: Describe better handling of indexes in ALTER TABLE ATTACH PARTITION
- e8fbe5d838f5 14 (unreleased) landed
- b3e99a561f70 15 (unreleased) landed
- 767142b8a8be 16 (unreleased) landed
- f67b9dd8fc70 17 (unreleased) landed
- d3ff08e66b43 18 (unreleased) landed
- 56f2b0b5334d 19 (unreleased) landed
-
Ignore invalid indexes when enforcing index rules in ALTER TABLE ATTACH PARTITION
- fc55c7ff8d12 16.0 cited
Attachments
- v1-0001-doc-attach-partition-invalid-index-skip.patch (application/octet-stream) patch v1-0001
Hi hackers, Commit fc55c7ff8d1 [1] (back-patched through v11 as e90e9275f56) added logic to skip invalid indexes when ALTER TABLE ... ATTACH PARTITION matches partition indexes to the parent table's indexes. This prevents choosing an incomplete partitioned index as a match, which could create inconsistent partition index trees. However, this behavior was never documented. A user who has an invalid index on a partition (e.g., from a failed CREATE INDEX CONCURRENTLY) may be surprised when ATTACH PARTITION silently creates a new index instead of attaching the existing one. The attached patch adds a sentence to the ALTER TABLE reference page noting that invalid indexes are skipped during this matching and that a new index is created when no valid equivalent is found. This is a doc-only change with no code modifications. I believe it could be back-patched to all supported branches since the behavior already exists there. [1] https://github.com/postgres/postgres/commit/e90e9275f56 -- Mohamed Ali AWS RDS