stat_record
stat_record_old · Background-worker snapshot recorder and reporting suite for PostgreSQL server statistics.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100453 | stat_record | stat_record_old | 0.4.0 | STAT | Unknown | C |
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | pg_stat_statements |
Usage
Sources:
stat_record runs a background worker that periodically snapshots cluster, database, object, query, WAL, and configuration statistics into the fixed _stat_record schema. It provides historical reports without an external scheduler, but the upstream repository is abandoned and explicitly warns that bugs exist.
Core Workflow
Install the extension and its pg_stat_statements dependency, configure both libraries for shared preload, then restart PostgreSQL:
After restart, the stat_record worker takes snapshots at the configured interval. A manual snapshot is also available:
Stored Data and Reports
_stat_record._record_number,_global_stat,_db_stat, and_query_statstore snapshot identifiers and statistics._stat_record.detail_record(bigint),global_report_record(bigint, bigint), andtotal_report_record(bigint, bigint)expose report views over snapshots._stat_record.delete_record(bigint)removes one snapshot;truncate_record(boolean)removes all history and can reset numbering._stat_record.export_total_report_record(bigint, bigint, text)writes a server-side CSV file at the supplied path.
Safety and Compatibility
Upstream states PostgreSQL 10 or later but does not document testing against modern statistics-catalog changes. Version 0.4.0 has no declared license and carries an explicit bug warning. The worker uses a configured database, stores query text and broad server metadata, and can create server-side files. Review worker privileges, query-text sensitivity, output paths, retention and table growth, restart behavior, and PostgreSQL-major compatibility. Prefer a maintained monitoring stack for production history, and test removal or upgrade with the worker stopped.