Re: Add starelid, attnum to pg_stats and leverage this in pg_dump

Corey Huinker <corey.huinker@gmail.com>

From: Corey Huinker <corey.huinker@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Sami Imseih <samimseih@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2026-03-17T02:05:51Z
Lists: pgsql-hackers
>
> Makes sense here to keep it simple.  I don't want to change the
> extstat restore code more than necessary at this stage of the CF
> calendar cycle, except for bugs and issues discussed during the beta
> cycle.


+1. I've also not advocated any changes to the extstat dump/restore code,
and I doubt I would until we start needing to fetch them in batches.

Commits

  1. pg_dump: Simplify query for retrieving attribute statistics.

  2. Add more columns to pg_stats, pg_stats_ext, and pg_stats_ext_exprs.

  3. Add convenience view to stats import test.