pg_trickle
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_trickle | 0.108.3 | FEAT | Apache-2.0 | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2860 | pg_trickle | Yes | Yes | Yes | Yes | No | No | pgtrickle |
PG18 only; requires preload and ships pg_trickle_dump. Built with pgrx 0.19.3.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.108.3 | 1817161514 | pg_trickle | - |
| RPM | PIGSTY | 0.108.3 | 1817161514 | pg_trickle_$v | - |
| DEB | PIGSTY | 0.108.3 | 1817161514 | postgresql-$v-pg-trickle | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.108.1 el8.x86_64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el8.x86_64.rpm
| N/A | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 0.108.1 el8.aarch64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el8.aarch64.rpm
| N/A | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 0.108.1 el9.x86_64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el9.x86_64.rpm
| N/A | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 0.108.1 el9.aarch64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el9.aarch64.rpm
| N/A | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 0.108.1 el10.x86_64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el10.x86_64.rpm
| N/A | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 0.108.1 el10.aarch64.pg18 : pg_trickle_18 pg_trickle_18-0.108.1-1PGSTY.el10.aarch64.rpm
| N/A | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 0.108.1 d12.x86_64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~bookworm_amd64.deb
| N/A | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 0.108.1 d12.aarch64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~bookworm_arm64.deb
| N/A | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 0.108.1 d13.x86_64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~trixie_amd64.deb
| N/A | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 0.108.1 d13.aarch64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~trixie_arm64.deb
| N/A | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 0.108.1 u22.x86_64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~jammy_amd64.deb
| N/A | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 0.108.1 u22.aarch64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~jammy_arm64.deb
| N/A | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 0.108.1 u24.x86_64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~noble_amd64.deb
| N/A | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 0.108.1 u24.aarch64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~noble_arm64.deb
| N/A | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 0.108.1 u26.x86_64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~resolute_amd64.deb
| N/A | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 0.108.1 u26.aarch64.pg18 : postgresql-18-pg-trickle postgresql-18-pg-trickle_0.108.1-1PGSTY~resolute_arm64.deb
| N/A | N/A | N/A | N/A |
Build
You can build the RPM / DEB packages for pg_trickle using pig build:
Install
You can install pg_trickle directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
Sources:
- 0.108.3 migration
- 0.108.2 migration
- sql/pg_trickle–0.108.0–0.108.1.sql
- Version 0.108.2 README
- SQL reference
- Configuration
- GUC catalog
- Upgrade guide
- Control file
- 0.107.0 to 0.108.0 migration
pg_trickle 0.108.2 maintains stream tables on PostgreSQL 18: ordinary queryable tables derived from a SQL query, refreshed incrementally when supported or recomputed in full. Tables may depend on other stream tables, forming a dependency graph. Same-transaction maintenance is also available.
Enable the Extension
Append pg_trickle to shared_preload_libraries and restart PostgreSQL, then install as a superuser. Size the background-worker pool for the deployment; the upstream example uses eight workers.
The default pg_trickle.cdc_mode is trigger: transactional change capture needs neither logical WAL nor replication slots. Opt-in auto starts with triggers and can move eligible sources to receipt-backed WAL capture. Explicit wal also falls back to triggers when admission or logical-decoding prerequisites fail. These choices have different write overhead and operational requirements.
Create and Refresh a Stream Table
initialize defaults to true, so creation populates the result. schedule accepts durations, cron expressions such as @hourly, or the default calculated schedule inherited from downstream dependents. AUTO selects differential maintenance where possible and can fall back to full refresh. DIFFERENTIAL rejects queries it cannot maintain incrementally; FULL truncates and reloads the result.
IMMEDIATE uses statement-level triggers inside the base-table write transaction. It does not use WAL capture and rejects an effective explicit WAL request. Use the documented query-admission rules for joins, aggregates, subqueries, recursive queries, and other supported shapes; support is not a promise that every SQL expression is differentiable.
Lifecycle and Monitoring
pgtrickle.alter_stream_table changes definitions or refresh policy, and pgtrickle.drop_stream_table removes managed tables. pgtrickle.repair_stream_table repairs missing capture infrastructure and resets maintenance state after events such as restore or operator DDL. Use lifecycle APIs instead of direct writes or foreign keys against managed stream tables.
Lifecycle functions require explicit execution grants and ownership checks; administrator-wide operations are restricted to the extension owner or superuser. Arbitrary-SQL helpers preserve caller privileges. Capture triggers add work to source writes, and refresh failures can accumulate change buffers, so monitor health and storage instead of treating a schedule as a hard freshness guarantee.
External Coordination and Output Deltas
orchestration_mode selects MANAGED scheduling or EXTERNAL coordination. External coordination cannot be combined with immediate maintenance. pgtrickle.integration_capabilities advertises the available contracts; version 0.108.0 exposes Graph V1 1.2 and Delta V1 1.1.
pgtrickle.output_delta_consumer_status reports consumers, while pgtrickle.validate_output_delta_consumer checks whether a consumer can resume. pgtrickle.request_output_delta_resnapshot, pgtrickle.begin_output_delta_resnapshot, and pgtrickle.ack_output_delta_resnapshot manage rebuilding a baseline. A resnapshot is fenced by database-instance identity, output-contract digest, and row-identity version. Follow the exact SQL reference signatures and acknowledgement protocol before advancing external delivery.
Upgrade to 0.108.2
Install the new library and extension files before applying the packaged migration:
The upgrade preserves consumers, cursors, batches, and typed payload while adding resnapshot fences. A 0.106.1 installation can traverse the packaged 0.107.0 migration. Validate every consumer before resuming delivery; INVALIDATED or RESNAPSHOT_REQUIRED requires a new acknowledged baseline. Older releases through 0.105.2 had documented differential-result bugs for certain query shapes; upgrading does not automatically repair previously materialized rows. Use the upgrade guide’s comparison and repair procedure where applicable.
Version 0.108.1
This patch keeps downstream IMMEDIATE tables current after upstream FULL refresh or truncation, recovers missing change buffers, and fixes unintended suspension after source schema changes and scalar-subquery differential refresh. PostgreSQL 18.6 support is added. After installing matching files run ALTER EXTENSION pg_trickle UPDATE TO '0.108.2' and verify dependent stream-table results and capture health.
Version 0.108.2 and Row Identity V3
The 0.108.2 migration fixes blank-padded character identity encoding through pgtrickle.encode_row_id_v3. It marks existing stream tables for reinitialization and blocks differential maintenance until a protected FULL rebuild. Existing output-delta consumers and durable cursors remain, but consumers move to RESNAPSHOT_REQUIRED; old resnapshot tokens are removed. Establish and acknowledge a new baseline before resuming external consumption. External refresh clients must fetch the new graph-contract digest. Budget for full recomputation and verify maintained results after upgrading. Queued change rows are retained while capture sentinels are replaced.
Version 0.108.3
0.108.3 aligns FULL and DIFFERENTIAL row identity when a projection omits its source primary key, including duplicate visible rows. The UNION ALL fast path is restricted to a complete UNION ALL query. After ALTER EXTENSION pg_trickle UPDATE TO '0.108.3', run a protected FULL refresh for every stream table marked for reinitialization, using pgtrickle.refresh_stream_table. Differential maintenance waits for that rebuild; queued CDC changes are retained. Verify output-delta consumer status and any required baseline before resuming delivery.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)