pg_running_stats
Mergeable Running Statistics (Welford/Chan) Extension for PostgreSQL
pg_running_stats · Mergeable Running Statistics (Welford/Chan) Extension for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101609 | pg_running_stats | pg_running_stats | 1.0 | FUNC | MIT | C |
Usage
Sources:
- Official upstream README
- Official extension control file (pg_running_stats.control)
- Official extension SQL (pg_running_stats–1.0.sql)
pg_running_stats — Mergeable Running Statistics (Welford/Chan) for PostgreSQL. Use it when SQL needs these specialized functions or aggregates. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
rstat_combine(a bytea, b bytea)is an extension function and returnsbytea.rstat_final(state bytea)is an extension function and returnsrstat_result_t.rstat_sfunc(state bytea, x double precision)is an extension function and returnsbytea.rstat_state_merge(a bytea, b bytea)is an extension function and returnsbytea.rstat_state_result(state bytea)is an extension function and returnsrstat_result_t.rstat_stateis an aggregate exposed by the extension.running_statsis an aggregate exposed by the extension.rstat_result_tis an extension-defined type.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.