Re: Unexpected reindex when altering column types for partitioned tables

From: Álvaro Rodríguez <alvaro(at)datadoghq(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unexpected reindex when altering column types for partitioned tables
Date: 2026-06-15 13:01:57
Message-ID: CA+C_kKVngP6=aT_5pU1BN67fzCu82b16ZMy42NW75qdNqptJuw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Added to CF, thanks Álvaro!

On Fri, Jun 12, 2026 at 3:03 PM Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> 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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuya Kawata 2026-06-15 13:12:08 Re: [PATCH] Change wait_time column of pg_stat_lock to double precision
Previous Message shveta malik 2026-06-15 12:55:33 Re: Proposal: Conflict log history table for Logical Replication