Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE - Mailing list pgsql-hackers

From solai v
Subject Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE
Date
Msg-id CAF0whufYksvfRiq9V3LF+o7s-Ts8ERxHSj6cVryN52-jnvmFqQ@mail.gmail.com
Whole thread
In response to Re: Preserve statistics targets with ALTER TABLE ALTER COLUMN TYPE  (Zsolt Parragi <zsolt.parragi@percona.com>)
List pgsql-hackers
On Thu, Oct 1, 2026 at 5:32 PM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
>
> I attached a rebased v2 since v1 no longer applies on master.
>
> I kept both 0001 and 0002 for now since the other thread including
> 0001 is also still under discussion.
Dear Zsolt,

I tested the rebased v2 patches on the latest master.
Both patches applied cleanly, and I tested the statistics-target
preservation during ALTER TABLE   ALTER COLUMN    TYPE.

0001 – Preserve statistics target of extended statistics-Verified that
a column statistics target set to 500 remained 500 after changing the
column type from int to bigint.
0002 – Preserve statistics targets of indexes rebuilt by ALTER
TABLE-Verified that an expression index statistics target set to 400
remained 400 after changing the underlying column type from text to
varchar(100).
Both test cases passed, and the configured statistics targets were
preserved after the type changes.

Regards,
solai



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgstat: allow a stats kind to use its own dedicated dsa/dshash
Next
From: Mario Karuza
Date:
Subject: Re: tuplesort_putdatum() does not account for tuple memory