On Sun, Dec 07, 2025 at 10:07:45PM +0100, Alvaro Herrera wrote:
> Hmm, as I recall it's quite intentional that the index on a partitioned
> table is marked !indisvalid; such indexes are only supposed to be marked
> valid once indexes on all partitions have been attached. As I recall,
> if you remove that prohibition, some pg_dump scenarios fail.
Right. If indisvalid is true on a partitioned table, then we are sure
that all its partitions have valid indexes. If indisvalid is false,
some of its partitions may have an invalid index. In the false case,
things can be a bit lossy as well. For example, an ALTER TABLE ONLY
could switch a partition's indisvalid to be true, without switching to
true the indisvalid of its partitioned table.
--
Michael