Re: Invalid index on partitioned table - is this a bug or feature? - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: Invalid index on partitioned table - is this a bug or feature?
Date
Msg-id 202501221757.tei43lwipeh3@alvherre.pgsql
Whole thread Raw
In response to Invalid index on partitioned table - is this a bug or feature?  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: Invalid index on partitioned table - is this a bug or feature?
List pgsql-hackers
On 2025-Jan-22, Dmitry Koval wrote:

> Hi!
> If you create an index on a partitioned table using a method that uses
> pg_dump:
> 
> (a) "ALTER TABLE ONLY ... ADD CONSTRAINT .. PRIMARY KEY ..."
> or
> (b) "CREATE INDEX ... ON ONLY ..."
> 
> then the index for the partitioned table is created with the INVALID
> flag.

Yes.  You need to attach child indexes on all partitions so that this
index becomes valid.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Dmitry Koval
Date:
Subject: Invalid index on partitioned table - is this a bug or feature?
Next
From: Alexander Kuzmenkov
Date:
Subject: Re: Quadratic planning time for ordered paths over partitioned tables