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-02-10T03:56:51Z
Lists: pgsql-hackers
On Mon, Feb 09, 2026 at 03:09:49PM -0500, Corey Huinker wrote:
> 0002 - minor tweaks to get v8 to build, kept separate to make applying on
> top of v8 easier

This is very slightly embarrassing.  Compilation was warning here,
just missed it.  Thanks.

> 0004 - Add the 3 range-stats to pg_stats_ext_exprs

This needed documentation and tests.  The former can be mostly taken
from pg_stats, at the difference that we are dealing with expressions
and not columns.  The latter can use a test with an expression based
on a range type, so as the fields queries are not NULL.  Added both of
these, and applied this patch.
--
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