synchdb
synchdb · Mixed C/Java PostgreSQL extension for direct CDC replication from MySQL, SQL Server, Oracle, and OpenLog Replicator sources.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101176 | synchdb | synchdb | 1.0 | ETL | Apache-2.0 | C |
PostgreSQL · 16, 17, 18
| Relationships | |
|---|---|
| Requires | pgcrypto |
Usage
Sources:
synchdb is a mixed C and Java PostgreSQL extension for initial snapshot plus change-data-capture replication from MySQL, SQL Server, Oracle, and OpenLog Replicator sources into PostgreSQL. It embeds Debezium connectors through the JVM and applies events inside PostgreSQL; it is not a bidirectional or PostgreSQL-to-PostgreSQL replication system.
Core Workflow
Install the extension, register a named connector, start its background worker, and inspect state. Upstream uses the literal text 'null' for unspecified table and snapshot fields because the registration function is strict.
Stop a connector before changing its definition or performing maintenance:
Management and Observability
synchdb_add_conninfo(...)stores a connector insynchdb_conninfo;synchdb_del_conninfo(name)removes it.synchdb_start_engine_bgw(name)starts snapshot plus streaming, while its two-argument overload selects a snapshot mode.synchdb_pause_engine(name),synchdb_resume_engine(name), andsynchdb_stop_engine_bgw(name)control execution.synchdb_state_viewexposes stage, state, process ID, last error, and source offset.synchdb_genstats,synchdb_snapstats, andsynchdb_cdcstatsexpose general, snapshot, and change-event counters;synchdb_reset_stats(name)resets a connector’s counters.- Object-map, datatype-translation, JMX, OpenLog Replicator, and offset functions support advanced connector configuration; follow the version-matched official guide rather than guessing their argument semantics.
Prerequisites and Operations
Version 1.0 requires pgcrypto, a JVM/JNI runtime, and the Java components installed alongside the C library. The pinned README lists Java 17 or later, PostgreSQL 16 through 18, and a Unix-like operating system; Oracle FDW snapshots and OpenLog Replicator builds add their own native dependencies.
Stored connector passwords are encrypted, but the initial secret still crosses the SQL statement and may reach client history, statement logs, audit logs, or monitoring. Use a tightly controlled administration session and least-privileged source accounts. Initial snapshots can be large, and DDL/type conversion, offsets, source retention, restarts, duplicate delivery, schema drift, and apply errors determine correctness. Test a representative source, monitor synchdb_state_view and the stats views, verify row counts and keys, and rehearse pause, resume, rebuild, and recovery before production use.