Add system view pg_stat_kind_info
Michael Paquier <michael@paquier.xyz>
Add system view pg_stat_kind_info This commit adds support for pg_stat_kind_info, that exposes at SQL level data about the statistics kinds registered into a backend: - Meta-data of a stats kind (built-in or custom, some properties). - Number of entries, if tracking is enabled. We have discussed the possibility of more fields (like shared memory size for a single entry); this adds the minimum agreed on. This is in spirit similar to pg_get_loaded_modules() for custom stats kinds, this view providing detailed information about the stats kinds when registered through shared_preload_libraries. Bump catalog version. Author: Tristan Partin <tristan@partin.io> Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/DI6OFGHJ1B69.25YVDEP3BABRH@partin.io
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +128 −0 |
| src/backend/catalog/system_views.sql | modified | +11 −0 |
| src/backend/utils/activity/Makefile | modified | +1 −0 |
| src/backend/utils/activity/meson.build | modified | +1 −0 |
| src/backend/utils/activity/pgstat_kind.c | added | +72 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +8 −0 |
| src/test/modules/test_custom_stats/t/001_custom_stats.pl | modified | +13 −1 |
| src/test/regress/expected/rules.out | modified | +8 −0 |
| src/test/regress/expected/stats.out | modified | +23 −0 |
| src/test/regress/sql/stats.sql | modified | +7 −0 |
Documentation touched
Discussion
- Add pg_stat_kind_info system view 25 messages · 2026-04-30 → 2026-07-06