Add information about range type stats to pg_stats_ext_exprs

This commit adds three attributes to the system view pg_stats_ext_exprs,
whose data can exist when involving a range type in an expression:
range_length_histogram
range_empty_frac
range_bounds_histogram

These statistics fields exist since 918eee0c497c, and have become
viewable in pg_stats later in bc3c8db8ae2f.  This puts the definition of
pg_stats_ext_exprs on par with pg_stats.

This issue has showed up during the discussion about the restore of
extended statistics for expressions, so as it becomes possible to query
the stats data to restore from the catalogs.  Having access to this data
is useful on its own, without the restore part.

Some documentation and some tests are added, written by me.  Corey has
authored the part in system_views.sql.

Bump catalog version.

Author: Corey Huinker <[email protected]>
Co-authored-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/307447e6dbc035c0e6e7a8ce9cee704a3b710ee9

Modified Files
--------------
doc/src/sgml/system-views.sgml          | 39 +++++++++++++++++++++++++++++++++
src/backend/catalog/system_views.sql    | 23 ++++++++++++++++++-
src/include/catalog/catversion.h        |  2 +-
src/test/regress/expected/rules.out     | 26 +++++++++++++++++++++-
src/test/regress/expected/stats_ext.out | 27 +++++++++++++++++++++++
src/test/regress/sql/stats_ext.sql      | 18 +++++++++++++++
6 files changed, 132 insertions(+), 3 deletions(-)

Reply via email to