Re: [PATCH] doc: Document that invalid indexes are skipped during ATTACH PARTITION

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Mohamed ALi <moali(dot)pg(at)gmail(dot)com>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] doc: Document that invalid indexes are skipped during ATTACH PARTITION
Date: 2026-06-03 07:27:18
Message-ID: ah_XViOx39uoL_kf@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 02, 2026 at 10:58:23PM -0700, Mohamed ALi wrote:
> The full paragraph now reads:
>
> For each index in the target table, if a valid equivalent
> index already exists in the partition, it will be attached
> to the target table's index, as if ALTER INDEX ATTACH
> PARTITION had been executed; otherwise, a corresponding
> one will be created. Any invalid indexes on the partition remain
> unchanged and should be dropped manually if they are no longer
> needed.

Hmm. How about?
For each index in the target table, if a valid equivalent index
already exists in the partition, it will be attached to the target
table's index, as if ALTER INDEX ATTACH PARTITION had been executed;
otherwise, a new corresponding index will be created. Invalid indexes
on the partition are skipped.

In short, I am not sure that there is a need to mention the drop;
that's up to the user to decide what to do and that's a DROP INDEX
thing, not an ALTER thing.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-06-03 07:32:00 CREATE TABLE LIKE INCLUDING PRIVILEGES
Previous Message Chao Li 2026-06-03 07:16:13 Fix \crosstabview to honor \pset display_true/display_false