| From: | Mohamed ALi <moali(dot)pg(at)gmail(dot)com> |
|---|---|
| To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, Sami Imseih <samimseih(at)gmail(dot)com> |
| Subject: | [PATCH] doc: Document that invalid indexes are skipped during ATTACH PARTITION |
| Date: | 2026-05-15 18:30:24 |
| Message-ID: | CAGnOmWpAMaE-BOkpwM6mJnHcpS2QZ8yLSSaqmz+vryEsbCWWWA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-doc-attach-partition-invalid-index-skip.patch | application/octet-stream | 1.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ayush Tiwari | 2026-05-15 18:33:35 | Re: [PATCH] refint: Avoid reusing cascade UPDATE plans. |
| Previous Message | Bruce Momjian | 2026-05-15 17:27:40 | Re: First draft of PG 19 release notes |