pglogical_ticker

Have an accurate view on pglogical replication delay

Overview

PackageVersionCategoryLicenseLanguage
pglogical_ticker1.4.1ETLPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
9510pglogical_tickerNoYesYesYesNoNopglogical_ticker
Relatedpglogical pglogical_origin pgl_ddl_deploy pg_failover_slots pgactive wal2json decoderbufs repmgr decoder_raw

require a patch on el, pg18 break on el

Version

TypeRepoVersionPG VerPackageDeps
EXTPGDG1.4.11817161514pglogical_tickerpglogical
RPMPIGSTY1.4.11817161514pglogical_ticker_$vpglogical_$v
DEBPGDG1.4.11817161514postgresql-$v-pglogical-tickerpostgresql-$v-pglogical
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
el8.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
el9.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
el9.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
el10.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
el10.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
d12.x86_64
PIGSTY 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
d12.aarch64
PIGSTY 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
d13.x86_64
PIGSTY 1.4.1
d13.aarch64
PIGSTY 1.4.1
u22.x86_64
PIGSTY 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
u22.aarch64
PIGSTY 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
u24.x86_64
PIGSTY 1.4.1
u24.aarch64
PIGSTY 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1
PGDG 1.4.1

Build

You can build the RPM / DEB packages for pglogical_ticker using pig build:

pig build pkg pglogical_ticker         # build RPM / DEB packages

Install

You can install pglogical_ticker directly. First, make sure the PGDG repository is added and enabled:

pig repo add pgdg -u          # Add PGDG repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pglogical_ticker;          # Install for current active PG version
pig ext install -y pglogical_ticker -v 18  # PG 18
pig ext install -y pglogical_ticker -v 17  # PG 17
pig ext install -y pglogical_ticker -v 16  # PG 16
pig ext install -y pglogical_ticker -v 15  # PG 15
pig ext install -y pglogical_ticker -v 14  # PG 14
dnf install -y pglogical_ticker_18       # PG 18
dnf install -y pglogical_ticker_17       # PG 17
dnf install -y pglogical_ticker_16       # PG 16
dnf install -y pglogical_ticker_15       # PG 15
dnf install -y pglogical_ticker_14       # PG 14
apt install -y postgresql-18-pglogical-ticker   # PG 18
apt install -y postgresql-17-pglogical-ticker   # PG 17
apt install -y postgresql-16-pglogical-ticker   # PG 16
apt install -y postgresql-15-pglogical-ticker   # PG 15
apt install -y postgresql-14-pglogical-ticker   # PG 14

Preload:

shared_preload_libraries = 'pglogical, pglogical_ticker';

Create Extension:

CREATE EXTENSION pglogical_ticker CASCADE;  -- requires: pglogical

Usage

pglogical_ticker: Have an accurate view on pglogical replication delay

A background worker that periodically updates ticker tables to measure pglogical replication lag from the provider’s standpoint.

Enabling

Add to postgresql.conf:

shared_preload_libraries = 'pglogical,pglogical_ticker'
pglogical_ticker.database = 'mydb'
pglogical_ticker.naptime = 10      -- tick interval in seconds (default 10)

Install on both provider and all subscribers:

CREATE EXTENSION pglogical_ticker;

Deploy Ticker Tables

Run on the provider only (propagated to subscribers via pglogical):

-- Deploy ticker tables (one per replication set)
SELECT pglogical_ticker.deploy_ticker_tables();

-- Add ticker tables to replication
SELECT pglogical_ticker.add_ticker_tables_to_replication();

For cascading replication:

SELECT pglogical_ticker.deploy_ticker_tables('my_cascaded_set_name');
SELECT pglogical_ticker.add_ticker_tables_to_replication('my_cascaded_set_name');

Manual Tick

SELECT pglogical_ticker.tick();

Launching the Ticker

The ticker auto-launches on server start if configured in shared_preload_libraries. Otherwise:

SELECT pglogical_ticker.launch();

-- Or, only launch if replication set tables exist
SELECT pglogical_ticker.launch_if_repset_tables();

Viewing Replication Delay

On the provider:

SELECT * FROM pglogical_ticker.all_repset_tickers();

On a subscriber:

SELECT * FROM pglogical_ticker.all_subscription_tickers();

Configuration

  • pglogical_ticker.database - Database to run the ticker in
  • pglogical_ticker.naptime - Tick interval in seconds (default 10)
  • pglogical_ticker.restart_time - Seconds before auto-restart (default 10, -1 to disable)

Last Modified 2026-03-12: add pg extension catalog (95749bf)