Re: Add expressions to pg_restore_extended_stats()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Corey Huinker <corey.huinker@gmail.com>
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-05T22:03:44Z
Lists: pgsql-hackers
On Thu, Mar 05, 2026 at 03:20:07PM -0500, Corey Huinker wrote:
> If this seems more elegant than what we have now, I'll write up a formal
> patch for the three set-difference types (attstats, extended, extended
> exprs).

Yes, the reduction of the bloat is nice to see:
 1 file changed, 52 insertions(+), 105 deletions(-)

Extending this concept to all of them should mean close to three times
the same amount of code shaved.
--
Michael

Commits

  1. Refactor tests for catalog diff comparisons in stats_import.sql

  2. Fix typo in stats_import.sql

  3. Add support for "exprs" in pg_restore_extended_stats()

  4. Add information about range type stats to pg_stats_ext_exprs

  5. Fix comment in extended_stats_funcs.c