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-04T22:29:29Z
Lists: pgsql-hackers
On Wed, Mar 04, 2026 at 05:05:55PM -0500, Corey Huinker wrote:
> 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.

I am not sure which one would be the best fit, TBH.  To me, it depends
mostly on clarity and how easier it becomes to maintain these tests.
Perhaps I would have a slight preference on the views with quals based
on the object names.  As long as we don't maintain the same
complicated queries more than once, I'm basically fine with any
solution.  Using json for this purpose feels a bit too much artistic.
--
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