pgactive

Active-Active Replication Extension for PostgreSQL

Overview

PackageVersionCategoryLicenseLanguage
pgactive2.1.7ETLApache-2.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
9550pgactiveYesYesYesYesNoNopg_catalog
Relatedpglogical pg_failover_slots repmgr bgw_replstatus pglogical_origin pglogical_ticker pgl_ddl_deploy decoderbufs

require libpgfeutils

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY2.1.71817161514pgactive-
RPMPIGSTY2.1.71817161514pgactive_$v-
DEBPIGSTY2.1.71817161514postgresql-$v-pgactive-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
u22.x86_64
u22.aarch64
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
u24.x86_64
u24.aarch64
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7
PIGSTY 2.1.7

Build

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

pig build pkg pgactive         # build RPM / DEB packages

Install

You can install pgactive directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

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

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

pig install pgactive;          # Install for current active PG version
pig ext install -y pgactive -v 18  # PG 18
pig ext install -y pgactive -v 17  # PG 17
pig ext install -y pgactive -v 16  # PG 16
pig ext install -y pgactive -v 15  # PG 15
pig ext install -y pgactive -v 14  # PG 14
dnf install -y pgactive_18       # PG 18
dnf install -y pgactive_17       # PG 17
dnf install -y pgactive_16       # PG 16
dnf install -y pgactive_15       # PG 15
dnf install -y pgactive_14       # PG 14
apt install -y postgresql-18-pgactive   # PG 18
apt install -y postgresql-17-pgactive   # PG 17
apt install -y postgresql-16-pgactive   # PG 16
apt install -y postgresql-15-pgactive   # PG 15
apt install -y postgresql-14-pgactive   # PG 14

Preload:

shared_preload_libraries = 'pgactive';

Create Extension:

CREATE EXTENSION pgactive;

Usage

pgactive: Active-Active Replication Extension for PostgreSQL

The pgactive extension provides active-active (multi-master) replication for PostgreSQL, where multiple database instances can accept writes and replicate changes to each other.

Enabling

CREATE EXTENSION pgactive;

Overview

pgactive enables active-active replication using logical replication as its foundation. Multiple databases in a cluster can accept changes and replicate them bidirectionally.

Key Concepts

  • Active-Active: All nodes accept reads and writes simultaneously
  • Asynchronous: Changes are replicated asynchronously between nodes
  • Conflict Resolution: Applications must handle conflicting changes from multiple writers
  • Logical Replication: Uses PostgreSQL’s logical decoding to interpret and apply changes

Use Cases

  • Multi-region high availability database clusters
  • Reducing write latency between applications and databases
  • Blue/green application updates
  • Data migration between systems that must both remain writable

Design Considerations

Applications using pgactive must be designed to handle:

  • Write conflicts: Concurrent modifications to the same row on different nodes
  • Replication lag: Changes may not be immediately visible on all nodes
  • Feature limitations: Some features like auto-incrementing sequences require special handling across nodes

Notes

  • Built on PostgreSQL’s native logical replication infrastructure
  • Requires PostgreSQL 10+ (native logical replication support)
  • Refer to the project documentation for detailed setup and conflict resolution strategies

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