PostgreSQL
TwinCommit captures changes from PostgreSQL with a logical replication slot and the built-in pgoutput plugin, so there are no extensions to install. It manages its own publication and slot and streams committed transactions in commit order.
Supported: PostgreSQL 13–18, Amazon RDS and Aurora PostgreSQL, Azure Database for PostgreSQL Flexible Server, Google Cloud SQL.
Prerequisites
Section titled “Prerequisites”Logical WAL
Section titled “Logical WAL”# postgresql.confwal_level = logicalmax_replication_slots = 10max_wal_senders = 10On managed services, set rds.logical_replication = 1 (AWS) or azure.replication_support = logical (Azure), or enable the cloudsql.logical_decoding flag (GCP).
CREATE ROLE twincommit WITH LOGIN REPLICATION PASSWORD '********';GRANT SELECT ON ALL TABLES IN SCHEMA public TO twincommit;GRANT CREATE ON DATABASE app TO twincommit; -- to create the publicationPrimary keys
Section titled “Primary keys”Tables need a primary key, or REPLICA IDENTITY FULL:
ALTER TABLE public.events REPLICA IDENTITY FULL;Configuration
Section titled “Configuration”source: type: postgres dsn: postgres://twincommit:${PG_SRC_PASSWORD}@pg-primary:5432/app slot: twincommit_app publication: twincommit_app