Re: Invalid index on partitioned table - is this a bug or feature?

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Invalid index on partitioned table - is this a bug or feature?
Date: 2025-01-22 17:57:11
Message-ID: 202501221757.tei43lwipeh3@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Kuzmenkov 2025-01-22 17:57:46 Re: Quadratic planning time for ordered paths over partitioned tables
Previous Message Dmitry Koval 2025-01-22 17:51:38 Invalid index on partitioned table - is this a bug or feature?