Re: Add expressions to pg_restore_extended_stats()
Corey Huinker <corey.huinker@gmail.com>
From: Corey Huinker <corey.huinker@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Chao Li <li.evan.chao@gmail.com>, Tender Wang <tndrwang@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Tomas Vondra <tomas@vondra.me>
Date: 2026-03-04T22:05:55Z
Lists: pgsql-hackers
> > 3. convert the record to jsonb, deleting the known annoying column keys > (oids, timestamps, etc) and then set-differencing those. > 4. do the views, but add in a regression check on the number of columns in > the base table, with a comment that says "if this check ever fails, the new > column(s) have to be added to the view above". > > For the reasons stated, I think it's down to options 3 and 4. Any > preferences? > or 5. Generate the column list of the view (or set difference queries) with a \gexec query that filters out the oids. All of these things are sliiightly hacky, but if we settle on one pattern that will allow us to use the pattern in multiple places and thus reduce surprise to the reader.
Commits
-
Refactor tests for catalog diff comparisons in stats_import.sql
- ccd7abaa456f 19 (unreleased) landed
-
Fix typo in stats_import.sql
- 9e8193a26229 19 (unreleased) landed
-
Add support for "exprs" in pg_restore_extended_stats()
- ba97bf9cb7b4 19 (unreleased) landed
-
Add information about range type stats to pg_stats_ext_exprs
- 307447e6dbc0 19 (unreleased) landed
-
Fix comment in extended_stats_funcs.c
- 9476ef206c64 19 (unreleased) landed