Re: BUG #18468: CREATE TABLE ... LIKE leaves orphaned column reference in extended statistics

Tender Wang <tndrwang@gmail.com>

From: Tender Wang <tndrwang@gmail.com>
To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-05-16T08:38:19Z
Lists: pgsql-bugs
generateClonedExtStatsStmt just copy t0's ext_stat info to t1.
I think we could do something in transformExtendedStatistics() as the
comments said.
in transformCreateStmt, has below code:
/*
* Postprocess extended statistics.
*/
transformExtendedStatistics(&cxt);

Right now, there is nothing to do in transformExtendedStatistics.
Can we update the varattno to the right value here?
-- 
Tender Wang
OpenPie:  https://en.openpie.com/

Commits

  1. Fix handling of extended expression statistics in CREATE TABLE LIKE.

  2. Extended statistics on expressions