Skip to content
pg_incremental

pg_incremental

pg_incremental : Incremental Processing by Crunchy Data

Overview

ID Extension Package Version Category License Language
2850
pg_incremental
pg_incremental
1.5.0
FEAT
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
Schemas pg_catalog
See Also
age
hll
rum
pg_graphql
pg_jsonschema
jsquery
pg_hint_plan

pg_cron is optional since v1.3 and only required for scheduled pipelines.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
1.5.0
18
17
16
15
14
pg_incremental -
RPM
PIGSTY
1.5.0
18
17
16
15
14
pg_incremental_$v -
DEB
PIGSTY
1.5.0
18
17
16
15
14
postgresql-$v-pg-incremental -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
el8.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
el9.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
el9.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
el10.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
el10.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
d12.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
d12.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
d13.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
d13.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u22.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u22.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u24.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u24.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u26.x86_64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
u26.aarch64
PIGSTY 1.5.0
PIGSTY 1.5.0
PIGSTY 1.5.0
MISS
MISS
Package Version OS ORG SIZE File URL
pg_incremental_18 1.5.0 el8.x86_64 pigsty 33.5 KiB pg_incremental_18-1.5.0-1PIGSTY.el8.x86_64.rpm
pg_incremental_18 1.0.0 el8.x86_64 pgdg 26.6 KiB pg_incremental_18-1.0.0-1PGDG.rhel8.x86_64.rpm
pg_incremental_18 1.5.0 el8.aarch64 pigsty 33.0 KiB pg_incremental_18-1.5.0-1PIGSTY.el8.aarch64.rpm
pg_incremental_18 1.0.0 el8.aarch64 pgdg 26.0 KiB pg_incremental_18-1.0.0-1PGDG.rhel8.aarch64.rpm
pg_incremental_18 1.5.0 el9.x86_64 pigsty 31.8 KiB pg_incremental_18-1.5.0-1PIGSTY.el9.x86_64.rpm
pg_incremental_18 1.0.0 el9.x86_64 pgdg 26.1 KiB pg_incremental_18-1.0.0-1PGDG.rhel9.x86_64.rpm
pg_incremental_18 1.5.0 el9.aarch64 pigsty 31.6 KiB pg_incremental_18-1.5.0-1PIGSTY.el9.aarch64.rpm
pg_incremental_18 1.0.0 el9.aarch64 pgdg 25.3 KiB pg_incremental_18-1.0.0-1PGDG.rhel9.aarch64.rpm
pg_incremental_18 1.5.0 el10.x86_64 pigsty 32.4 KiB pg_incremental_18-1.5.0-1PIGSTY.el10.x86_64.rpm
pg_incremental_18 1.0.0 el10.x86_64 pgdg 26.8 KiB pg_incremental_18-1.0.0-1PGDG.rhel10.x86_64.rpm
pg_incremental_18 1.5.0 el10.aarch64 pigsty 31.9 KiB pg_incremental_18-1.5.0-1PIGSTY.el10.aarch64.rpm
pg_incremental_18 1.0.0 el10.aarch64 pgdg 26.1 KiB pg_incremental_18-1.0.0-1PGDG.rhel10.aarch64.rpm
postgresql-18-pg-incremental 1.5.0 d12.x86_64 pigsty 55.9 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-incremental 1.5.0 d12.aarch64 pigsty 54.8 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-incremental 1.5.0 d13.x86_64 pigsty 55.9 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-incremental 1.5.0 d13.aarch64 pigsty 54.8 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-incremental 1.5.0 u22.x86_64 pigsty 57.4 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-incremental 1.5.0 u22.aarch64 pigsty 56.6 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-incremental 1.5.0 u24.x86_64 pigsty 56.3 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~noble_amd64.deb
postgresql-18-pg-incremental 1.5.0 u24.aarch64 pigsty 55.6 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~noble_arm64.deb
postgresql-18-pg-incremental 1.5.0 u26.x86_64 pigsty 56.0 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~resolute_amd64.deb
postgresql-18-pg-incremental 1.5.0 u26.aarch64 pigsty 55.5 KiB postgresql-18-pg-incremental_1.5.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pg_incremental;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_incremental;		# install via package name, for the active PG version

pig install pg_incremental -v 18;   # install for PG 18
pig install pg_incremental -v 17;   # install for PG 17
pig install pg_incremental -v 16;   # install for PG 16

Create this extension with:

CREATE EXTENSION pg_incremental;

Usage

pg_incremental defines exactly-once incremental pipelines for append-only tables and file feeds. Upstream documents three pipeline types: sequence, time-interval, and file-list.

Install And Scheduling Model

The upstream README still documents pg_cron-backed scheduling and installs with:

CREATE EXTENSION pg_incremental CASCADE;

Pipelines run immediately when created unless execute_immediately := false, then continue on a pg_cron schedule. The README notes that each scheduled execution appears in cron.job_run_details even when no new data is available.

Sequence Pipelines

Use sequence pipelines to process safe ranges of sequence values:

SELECT incremental.create_sequence_pipeline('event-aggregation', 'events', $$
  INSERT INTO events_agg
  SELECT date_trunc('day', event_time), count(*)
  FROM events
  WHERE event_id BETWEEN $1 AND $2
  GROUP BY 1
  ON CONFLICT (day) DO UPDATE
  SET event_count = events_agg.event_count + excluded.event_count
$$);

The README documents max_batch_size for limiting how many sequence IDs are processed per run.

Time-Interval Pipelines

Use time windows when the command should receive $1 and $2 as a passed interval:

SELECT incremental.create_time_interval_pipeline('event-aggregation', '1 day', $$
  INSERT INTO events_agg
  SELECT event_time::date, count(DISTINCT event_id)
  FROM events
  WHERE event_time >= $1 AND event_time < $2
  GROUP BY 1
$$);

For export-style jobs, the README documents batched := false so each interval runs separately.

File-List Pipelines

Use file-list pipelines to process newly discovered files:

SELECT incremental.create_file_list_pipeline('event-import', 's3://mybucket/events/*.csv', $$
  SELECT import_events($1)
$$);

The v1.5.0 release adds max_batches_per_run to file-list pipelines. The README documents incremental.skip_file() for permanently marking a bad file as processed.

Operations And Monitoring

The README documents:

  • CALL incremental.execute_pipeline(name): run once if new work exists.
  • SELECT incremental.reset_pipeline(name): reset progress.
  • SELECT incremental.drop_pipeline(name): remove a pipeline.
  • Views and tables such as incremental.sequence_pipelines, incremental.time_interval_pipelines, incremental.file_list_pipelines, and incremental.processed_files.

The v1.5.0 release note also calls out a DROP EXTENSION fix for environments where pg_cron is not present.

Last updated on