Skip to content

jsonb_stats

Mergeable JSONB statistics and exact numeric aggregation.

jsonb_stats · Mergeable JSONB statistics and exact numeric aggregation.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102312jsonb_statsjsonb_stats3.2.0STATRust

PostgreSQL · 18

Usage

Sources:

jsonb_stats 3.2.0 builds mergeable statistical summaries for dynamically named JSONB variables.

Core Workflow

stat constructs a typed value. jsonb_stats_agg aggregates statistics and jsonb_stats_merge_agg combines existing summaries. Numeric state includes count, sum, sum of squares, minimum and maximum; the 3.x representation uses exact arithmetic rather than an order-dependent floating-point accumulator.

CREATE EXTENSION jsonb_stats;
SELECT stat(42::integer);

Operational Boundaries

This release’s build feature targets PostgreSQL 18. Installation is marked non-superuser, but the role still needs database/schema privileges for its objects. When upgrading, install matching files, reconnect to load the new library, then run ALTER EXTENSION UPDATE. Do not mix persisted summaries from incompatible major representations without following upstream migration guidance.

Table reader