Add more columns to pg_stats, pg_stats_ext, and pg_stats_ext_exprs.
Nathan Bossart <nathan@postgresql.org>
Add more columns to pg_stats, pg_stats_ext, and pg_stats_ext_exprs. This commit adds table OID and attribute number columns to pg_stats, and it adds table OID and statistics object OID columns to pg_stats_ext and pg_stats_ext_exprs. A proposed follow-up commit would use pg_stats.tableid to simplify a query in pg_dump. The others have no immediate purpose but may be useful later. Bumps catversion. Author: Corey Huinker <corey.huinker@gmail.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CADkLM%3DcoCVy92QkVUUTLdo5eO2bMDtwMrzRn_8miAhX%2BuPaqXg%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/system-views.sgml | modified | +60 −0 |
| src/backend/catalog/system_views.sql | modified | +6 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/test/regress/expected/rules.out | modified | +6 −0 |
| src/test/regress/expected/stats_import.out | modified | +2 −2 |
Discussion
- Add starelid, attnum to pg_stats and leverage this in pg_dump 36 messages · 2026-02-25 → 2026-03-17