pgactive
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgactive | 2.1.7 | ETL | Apache-2.0 | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9550 | pgactive | Yes | Yes | Yes | Yes | No | No | pg_catalog |
| Related | pglogical pg_failover_slots repmgr bgw_replstatus pglogical_origin pglogical_ticker pgl_ddl_deploy decoderbufs |
|---|
require libpgfeutils
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.1.7 | 1817161514 | pgactive | - |
| RPM | PIGSTY | 2.1.7 | 1817161514 | pgactive_$v | - |
| DEB | PIGSTY | 2.1.7 | 1817161514 | postgresql-$v-pgactive | - |
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
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.