Skip to content

pg_relay

Durable event processor for PostgreSQL

pg_relay · Durable event processor for PostgreSQL

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101605pg_relaypg_relay1.5FEATMITSQL

PostgreSQL · 15, 16, 17, 18, 19

Usage

Sources:

pg_relay enqueues events in the caller’s transaction. After commit, a separate Processor polls the queue, executes the SQL registered for the channel and records its outcome. Rolling back the transaction also rolls back the event.

Basic use

CREATE EXTENSION pg_relay;
SELECT pgrelay.register('calibration_example', 'SELECT $1::bigint');
SELECT pgrelay.notify('calibration_example', '42');

Upstream supports self-managed PostgreSQL 15 and later. Install as an administrator in the fixed pgrelay schema and register channels with an authorized role. Release 1.5.0 installs SQL extension version 1.5.

Runtime behavior

Run the pg_relay executable against the same database with a role authorized to process the queue. Creating the extension alone leaves the Processor stopped. Review completed dispatches in pgrelay.log.

Table reader