pg_fact_loader
build fact tables with Postgres
Repository
enova/pg_fact_loader
https://github.com/enova/pg_fact_loader
Source
pg_fact_loader-2.0.1.tar.gz
pg_fact_loader-2.0.1.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_fact_loader | 2.0.1 | ETL | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9820 | pg_fact_loader | No | Yes | No | Yes | No | No | fact_loader |
PGDG provides the regular DEB channel; Pigsty fills the missing PostgreSQL 18 packages on Debian/Ubuntu and builds PG14-18 for Ubuntu 26.04 (Resolute).
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.0.1 | 1817161514 | pg_fact_loader | - |
| RPM | PGDG | 2.0.1 | 1817161514 | pg_fact_loader_$v | - |
| DEB | PGDG | 2.0.1 | 1817161514 | postgresql-$v-pg-fact-loader | - |
Build
You can build the DEB packages for pg_fact_loader using pig build:
Install
You can install pg_fact_loader directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
Usage
Build and maintain fact tables using queue-based change data capture. Processes audit/change log tables to incrementally update fact tables.
Enabling
Optionally with pglogical for replica-based setup:
Workflow
- Replicate source tables to a reporting database (via pglogical or other means)
- Create audit/change log tables on the OLTP system for source tables
- Create a fact table structure for aggregated data
- Create a merge function that takes a key ID and returns one row of the fact table
- Configure pg_fact_loader to wire queue tables to fact tables
- Backfill the fact table initially
- Schedule the worker to process changes continuously
Configuration Tables
Running the Worker
Initial Backfill
Adding Batch ID Fields
Key Features
- Queue-based incremental fact table updates
- Supports insert, update, and delete events
- Handles multi-level key retrieval (joins through multiple tables)
- Fact table dependency chains (child facts updated after parent)
- Checks replication lag before processing (when used with pglogical)
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)