pg_accumulator
pg_accumulator : Accumulation registers for balance and turnover tracking in PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4845 | pg_accumulator | pg_accumulator | 1.1.3 |
FUNC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | accum |
| Requires | plpgsql |
| See Also | currency financial omni_ledger |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.1.3 |
18 17 16 15 14 | pg_accumulator |
plpgsql |
| RPM | PIGSTY | 1.1.3 |
18 17 16 15 14 | pg_accumulator_$v |
- |
| DEB | PIGSTY | 1.1.3 |
18 17 16 15 14 | postgresql-$v-pg-accumulator |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| el8.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| el9.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| el9.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| el10.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| el10.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| d12.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| d12.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| d13.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| d13.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u22.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u22.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u24.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u24.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u26.x86_64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
| u26.aarch64 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 | PIGSTY 1.1.3 |
Source
github.com/Treedo/pg_accumulator
pg_accumulator-1.1.3.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources: README, documentation, control file
pg_accumulator implements declarative accumulation registers for PostgreSQL. A register records movements across arbitrary dimensions and resources, then exposes generated functions for balances, turnovers, movement history, verification, and rebuild operations.
Enable
For high-write workloads that use the delta buffer and background worker, preload the library and restart PostgreSQL:
Create A Register
The call creates the register metadata, movement table, total tables, balance cache, triggers, generated query functions, and supporting indexes.
Post And Query Movements
Corrections And Maintenance
Use register_unpost and register_repost for retroactive corrections. Use register_verify, register_rebuild_totals, and register_rebuild_cache to check and repair derived state when needed.
Configuration
The documented GUCs include pg_accumulator.background_workers, pg_accumulator.delta_merge_interval, pg_accumulator.delta_merge_delay, pg_accumulator.delta_merge_batch_size, pg_accumulator.partitions_ahead, and pg_accumulator.maintenance_interval.