spock
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
spock | 5.0.10 | ETL | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9570 | spock | Yes | Yes | Yes | Yes | No | No | spock |
| Related | pglogical pgactive mimeo pgoutput pgl_ddl_deploy logical_ddl postgres_fdw lolor citus plproxy |
|---|
works on pgedge kernel fork
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 5.0.10 | 1817161514 | spock | - |
| RPM | PIGSTY | 18.4 | 1817161514 | pgedge-$v | - |
| DEB | PIGSTY | 18.4 | 1817161514 | pgedge-$v | - |
Build
You can build the RPM / DEB packages for spock using pig build:
Install
You can install spock directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
Sources:
spock provides active-active logical replication for PostgreSQL 15 through 18. Each participating database is a Spock node; a multi-master topology is formed by creating directed subscriptions between nodes.
Configuration
In postgresql.conf:
Enabling
Creating Nodes
On each node, create a node identity:
Creating Subscriptions
For multi-master, each node subscribes to every other node:
Replication Set Management
Key Features
- Multi-master (active-active) replication
- Automatic DDL replication
- Conflict detection and resolution using commit timestamps
- Row and column filtering
- Supports PostgreSQL 15, 16, 17, and 18
- Tables must have primary keys and matching schemas across nodes
Operations and Caveats
- Install
spockand add it toshared_preload_librarieson every participating server before creating nodes or subscriptions. - Keep table definitions, data types, primary keys, and relevant unique indexes identical across nodes. Coordinate DDL even when DDL replication is enabled.
- Replicated tables need a primary key or another usable replica identity. Temporary and unlogged tables are not replication targets.
- Spock operates per database. Repeat extension and topology setup for each database that participates.
- Active-active conflict handling depends on commit timestamps and policy. Test simultaneous inserts and updates, especially nullable unique keys, before production use.
- Upstream documents platform/build requirements in the README; verify that the PostgreSQL build and Spock package used on every node are compatible.
Version 5.0.10
5.0.10 is a patch release in the 5.0 line. Its release notes include fixes for unique indexes containing NULL, NULLS NOT DISTINCT conflict handling, refreshing cached index metadata after an index is dropped, exception-path memory handling, and numerical version checks used during rolling patch upgrades. Upgrade every node to a compatible patch level and validate subscriptions after the rolling change.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)