Re: Unexpected reindex when altering column types for partitioned tables - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: Unexpected reindex when altering column types for partitioned tables
Date
Msg-id aivfWM5P77rer3rM@alvherre.pgsql
Whole thread
In response to Unexpected reindex when altering column types for partitioned tables  (Álvaro Rodríguez <alvaro@datadoghq.com>)
Responses Re: Unexpected reindex when altering column types for partitioned tables
List pgsql-hackers
Hi,

On 2026-Jun-08, Álvaro Rodríguez wrote:

> When running the ALTER TABLE ALTER COLUMN TYPE operation, certain type
> changes are supposed to not require a reindex. For example, text to
> varchar or varchar(n) to varchar(m) when m > n. However, this turns
> out to not be the case for indexes (including pk / unique constraints)
> on partitioned tables. Patch 0001 (attached) demonstrates this
> behavior with a new regression test. In this case, the table rewrite
> is avoided but the indexes are rebuilt.

I agree with the problem statement, and I think the proposed solution
has the right shape.  This obviously has to be kept for pg20, so let's
discuss further during the next commitfest; please create a CF entry for
it.

Thanks,

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



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Fix ALTER DOMAIN VALIDATE CONSTRAINT locking
Next
From: Daniel Gustafsson
Date:
Subject: Re: PostgreSQL and OpenSSL 4.0.0