Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Oct 10, 2025 at 07:37:59AM -0500, Sami Imseih wrote:
> As you can see, the index stats (linked to the column that has been altered) are
> not preserved. I think that they should be preserved (like a REINDEX does).
> Hmm. Why should it be always OK to preserve the stats of an index
> when one of its attributes is changed so as a relation is rewritten?
Right offhand, this proposal seems utterly unsafe, to the point of
maybe introducing security-grade bugs. I see that the patch compares
opfamilies but that seems insufficient, since "same opfamily" does not
mean "binary compatible". We could easily be restoring stats whose
binary content is incompatible with the new column type.
regards, tom lane