Re: BUG #19833: ALTER TABLE that rebuilds an extended statistics object silently drops its SET STATISTICS target (st

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: 303677365(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19833: ALTER TABLE that rebuilds an extended statistics object silently drops its SET STATISTICS target (st
Date: 2026-12-02 05:50:46
Message-ID: CAH2L28vV-4O+8BZBTGnOteZw_wHt1VVRkkLy3zmN8yUgWUBLZA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

> > ALTER TABLE st2 ALTER COLUMN c TYPE int;
> >
> > SELECT i.indexrelid::regclass::text AS index_name, a.attstattarget
> > FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indexrelid AND
> > a.attnum = 1 WHERE i.indrelid = 'st2'::regclass;
> > index_name | attstattarget
> > ------------+---------------
> > st2_cb |
> > (1 row)
>
> Hmm, yes, that feels counter-intuitive to not preserve that.
>
> > I will look into writing a fix for this.
>
> Cool, thanks.

A fix for this had already been proposed here: [1]

We can continue the discussion on that thread.

[1].
https://www.postgresql.org/message-id/flat/CAN4CZFNZwcCgi-igaD%3DLH1ubxMBqJJS%2Bp4ZnOKKdCi9duaMu_w%40mail.gmail.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Jeff Davis 2026-12-02 05:25:11 Regex fails to capture group consisting of empty string in non-greedy case