Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE

From: Melanie Plageman <melanieplageman(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE
Date: 2026-08-24 22:30:46
Message-ID: CAAKRu_YGVk0n7jugpyqrkXc5qBWDfjxhfs814MoJiZ8wrFwUzA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 14, 2026 at 6:38 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> While looking at 6713a6e04cb I noticed a similar issue with statistics
> targets: ALTER TABLE ALTER COLUMN TYPE forgets the statistics targets
> when it recreates the extended statistics that depend on the altered
> column, or on an index that depends on the altered column.
>
> The attached patches fix this limitation.

Hi Zsolt,

I haven't dug into 0001, but I modified and included 0002 in another
series posted here [1].

- Melanie

[1] https://www.postgresql.org/message-id/CAAKRu_ajK0QhmOA3N2-QynT7hXx-VVV99RTXrae3sc51we2TSA%40mail.gmail.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Bharath Rupireddy 2026-08-24 22:29:00 Re: [PATCH] Release replication slot on error in SQL-callable slot functions