An enhanced PostgreSQL logical replication tool that supports bi-directional replication, table mapping, and last-writer-win conflict resolution.
pgcat is an enhanced logical replication tool for PostgreSQL that extends the native replication features. It solves limitations like restricted target table types, lack of conflict resolution, and the inability to safely perform bi-directional replication. It enables flexible data synchronization across diverse PostgreSQL setups, including views, partitioned tables, and distributed systems.
Database administrators and developers managing PostgreSQL deployments that require robust, flexible logical replication across data centers, heterogeneous table types, or distributed databases.
Developers choose pgcat over PostgreSQL's built-in logical replication for its extended target support, safe bi-directional replication, table mapping, and built-in conflict resolution, which are essential for complex, distributed database environments.
Enhanced PostgreSQL logical replication
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports replication to non-standard table types like views, FDW tables, and Citus distributed tables, which native PostgreSQL restricts to base tables, enabling diverse data synchronization.
Filters only local changes to prevent replication loops, allowing safe data synchronization between multiple data centers without deadlocks, as highlighted in the README.
Offers optional last-writer-win resolution with timestamps or Cassandra-like counters, handling concurrent updates in distributed setups to maintain data consistency.
Stores replication progress in a database table instead of a file, ensuring logged durability and easier failover recovery, unlike PostgreSQL's native approach.
Requires building from source, configuring PostgreSQL extensions, managing separate user roles, and running external processes, making it more involved than native replication.
When replicating to views, must set copy_data to false and avoid instead of triggers, limiting functionality for certain use cases as admitted in the limitations section.
Without LWW, conflicts require manual updates to LSNs in the pgcat_subscription_progress table, which can be error-prone and disrupt replication in production.