public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: Add information about range type stats to pg_stats_ext_exprs
Date: Tue, 10 Feb 2026 03:38:06 +0000
Message-ID: <[email protected]> (raw)

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Add information about range type stats to pg_stats_ext_exprs
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox