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: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org, Tomas Vondra <tomas.vondra@enterprisedb.com>
Date: 2024-05-20T07:31:10Z
Lists: pgsql-bugs
Tom Lane <tgl@sss.pgh.pa.us> 于2024年5月18日周六 04:39写道: > I wrote: > > We don't know the column mapping there, either. What we need to have > > our hands on is the "attmap" computed in expandTableLikeClause, and > > then we can pass the stats expressions through map_variable_attnos(). > > > I think this might not need to be a really large patch, but it > > definitely has to change where generateClonedExtStatsStmt is > > called from. I can have a go at it if Tomas doesn't want to. > > Yeah, this doesn't require a whole lot more than moving the > processing in transformTableLikeClause to expandTableLikeClause. > > I chose to get rid of transformExtendedStatistics, because not > only is there nothing for it to do, there will never be any > statements for it to do nothing to. > The patch looks good to me. -- Tender Wang OpenPie: https://en.openpie.com/
Commits
-
Fix handling of extended expression statistics in CREATE TABLE LIKE.
- 5278668d7a46 17.0 landed
- 2f3cfcf7677f 15.8 landed
- 2aa90c02dc69 16.4 landed
- 1015162c3535 14.13 landed
-
Extended statistics on expressions
- a4d75c86bf15 14.0 cited