pg_accumulator
PostgreSQL 中用于余额与周转跟踪的累积寄存器
仓库
Treedo/pg_accumulator
https://github.com/Treedo/pg_accumulator
源码
pg_accumulator-1.2.0.tar.gz
pg_accumulator-1.2.0.tar.gz
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
pg_accumulator | 1.2.0 | FUNC | PostgreSQL | C |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 4845 | pg_accumulator | 否 | 是 | 否 | 是 | 否 | 否 | accum |
版本
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.2.0 el8.x86_64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.2.0 el8.x86_64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.2.0 el8.x86_64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.2.0 el8.x86_64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el8.x86_64.rpm
| PIGSTY 1.2.0 el8.x86_64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el8.x86_64.rpm
|
| el8.aarch64 | PIGSTY 1.2.0 el8.aarch64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.2.0 el8.aarch64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.2.0 el8.aarch64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.2.0 el8.aarch64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el8.aarch64.rpm
| PIGSTY 1.2.0 el8.aarch64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el8.aarch64.rpm
|
| el9.x86_64 | PIGSTY 1.2.0 el9.x86_64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.2.0 el9.x86_64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.2.0 el9.x86_64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.2.0 el9.x86_64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el9.x86_64.rpm
| PIGSTY 1.2.0 el9.x86_64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 1.2.0 el9.aarch64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.2.0 el9.aarch64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.2.0 el9.aarch64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.2.0 el9.aarch64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el9.aarch64.rpm
| PIGSTY 1.2.0 el9.aarch64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 1.2.0 el10.x86_64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.2.0 el10.x86_64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.2.0 el10.x86_64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.2.0 el10.x86_64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el10.x86_64.rpm
| PIGSTY 1.2.0 el10.x86_64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 1.2.0 el10.aarch64.pg18 : pg_accumulator_18 pg_accumulator_18-1.2.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.2.0 el10.aarch64.pg17 : pg_accumulator_17 pg_accumulator_17-1.2.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.2.0 el10.aarch64.pg16 : pg_accumulator_16 pg_accumulator_16-1.2.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.2.0 el10.aarch64.pg15 : pg_accumulator_15 pg_accumulator_15-1.2.0-1PGSTY.el10.aarch64.rpm
| PIGSTY 1.2.0 el10.aarch64.pg14 : pg_accumulator_14 pg_accumulator_14-1.2.0-1PGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 1.2.0 d12.x86_64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.2.0 d12.x86_64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.2.0 d12.x86_64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.2.0 d12.x86_64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~bookworm_amd64.deb
| PIGSTY 1.2.0 d12.x86_64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 1.2.0 d12.aarch64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.2.0 d12.aarch64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.2.0 d12.aarch64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.2.0 d12.aarch64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~bookworm_arm64.deb
| PIGSTY 1.2.0 d12.aarch64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 1.2.0 d13.x86_64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.2.0 d13.x86_64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.2.0 d13.x86_64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.2.0 d13.x86_64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~trixie_amd64.deb
| PIGSTY 1.2.0 d13.x86_64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 1.2.0 d13.aarch64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.2.0 d13.aarch64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.2.0 d13.aarch64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.2.0 d13.aarch64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~trixie_arm64.deb
| PIGSTY 1.2.0 d13.aarch64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 1.2.0 u22.x86_64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.2.0 u22.x86_64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.2.0 u22.x86_64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.2.0 u22.x86_64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~jammy_amd64.deb
| PIGSTY 1.2.0 u22.x86_64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 1.2.0 u22.aarch64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.2.0 u22.aarch64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.2.0 u22.aarch64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.2.0 u22.aarch64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~jammy_arm64.deb
| PIGSTY 1.2.0 u22.aarch64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 1.2.0 u24.x86_64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.2.0 u24.x86_64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.2.0 u24.x86_64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.2.0 u24.x86_64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~noble_amd64.deb
| PIGSTY 1.2.0 u24.x86_64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 1.2.0 u24.aarch64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.2.0 u24.aarch64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.2.0 u24.aarch64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.2.0 u24.aarch64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~noble_arm64.deb
| PIGSTY 1.2.0 u24.aarch64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~noble_arm64.deb
|
| u26.x86_64 | PIGSTY 1.2.0 u26.x86_64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.2.0 u26.x86_64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.2.0 u26.x86_64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.2.0 u26.x86_64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~resolute_amd64.deb
| PIGSTY 1.2.0 u26.x86_64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~resolute_amd64.deb
|
| u26.aarch64 | PIGSTY 1.2.0 u26.aarch64.pg18 : postgresql-18-pg-accumulator postgresql-18-pg-accumulator_1.2.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.2.0 u26.aarch64.pg17 : postgresql-17-pg-accumulator postgresql-17-pg-accumulator_1.2.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.2.0 u26.aarch64.pg16 : postgresql-16-pg-accumulator postgresql-16-pg-accumulator_1.2.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.2.0 u26.aarch64.pg15 : postgresql-15-pg-accumulator postgresql-15-pg-accumulator_1.2.0-1PGSTY~resolute_arm64.deb
| PIGSTY 1.2.0 u26.aarch64.pg14 : postgresql-14-pg-accumulator postgresql-14-pg-accumulator_1.2.0-1PGSTY~resolute_arm64.deb
|
构建
您可以使用 pig build 命令构建 pg_accumulator 扩展的 RPM / DEB 包:
安装
您可以直接安装 pg_accumulator 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
使用 pig 或者是 apt/yum/dnf 安装扩展:
安装
pig
dnf
apt
创建扩展:
用法
来源:README,documentation,control file
pg_accumulator 为 PostgreSQL 提供声明式累积寄存器。寄存器按任意维度和资源记录业务流水,并生成余额、发生额、流水历史、校验和重建等查询与维护函数。
启用
如果高写入场景需要 delta buffer 和后台 worker,需要预加载共享库并重启 PostgreSQL:
创建寄存器
一次调用会创建寄存器元数据、流水表、汇总表、余额缓存、触发器、生成查询函数和配套索引。
记账与查询
更正与维护
使用 register_unpost 和 register_repost 处理追溯更正。必要时使用 register_verify、register_rebuild_totals、register_rebuild_cache 校验和修复派生状态。
配置
文档中的 GUC 包括 pg_accumulator.background_workers、pg_accumulator.delta_merge_interval、pg_accumulator.delta_merge_delay、pg_accumulator.delta_merge_batch_size、pg_accumulator.partitions_ahead、pg_accumulator.maintenance_interval。
这个页面对您有帮助吗?
感谢反馈,我们会据此改进这篇文档。
哪里没有解决?(可选)