pgactive
pgactive
pgactive : Active-Active Replication Extension for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9550 | pgactive | pgactive | 2.1.7 | ETL | Apache-2.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--sLd-- | Yes | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | pg_catalog |
| See Also | pglogical pg_failover_slots repmgr bgw_replstatus pglogical_origin pglogical_ticker pgl_ddl_deploy decoderbufs |
require libpgfeutils
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.1.7 | 18 17 16 15 14 | pgactive | - |
| RPM | PIGSTY | 2.1.7 | 18 17 16 15 14 | pgactive_$v | - |
| DEB | PIGSTY | 2.1.7 | 18 17 16 15 14 | postgresql-$v-pgactive | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
el8.aarch64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
el9.x86_64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
el9.aarch64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
el10.x86_64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
el10.aarch64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
d12.x86_64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
d12.aarch64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
d13.x86_64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
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 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
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 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
u24.aarch64 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 | PIGSTY 2.1.7 |
Source
pig build pkg pgactive; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pgactive; # install via package name, for the active PG version
pig install pgactive -v 18; # install for PG 18
pig install pgactive -v 17; # install for PG 17
pig install pgactive -v 16; # install for PG 16
pig install pgactive -v 15; # install for PG 15
pig install pgactive -v 14; # install for PG 14Config this extension to shared_preload_libraries:
shared_preload_libraries = 'pgactive';Create this extension with:
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 updated on