Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PostgreSQL CDC (logical replication)

Schemes: postgres-cdc://, pgcdc://

Query parameters recognised as config fields for this connector. The object-typed tls is set with a JSON literal, e.g. ?tls={...}. Any other ?key=value pair is passed through unchanged as a driver option on the connection URL.

NameTypeRequiredDefaultDescription
checkpoint_storestringno—Local file (path or file://) for resume state; unset, the slot alone tracks the stream.
consumecapture_new | capture_all | snapshotno—(Consumer only) What to read: capture_new (default, changes only), capture_all (backfill the tables first, then changes) or snapshot (backfill only).
create_publicationbooleannofalseCreate the publication if missing (default false; leave off if it pre-exists). Needs table ownership for publication_tables, or superuser when none are set (FOR ALL TABLES).
create_slotbooleannotrueCreate the replication slot if it does not exist.
cursor_idstringno—Checkpoint key for the confirmed LSN and backfill progress; defaults to slot_name.
id_hashfnv1a | sha256nofnv1aHash for change message_ids: fnv1a (default, keeps existing dedup state) or sha256.
publicationstringyes—Publication name (must already exist; defines which tables are captured).
publication_tablesarray of stringnosee belowTables to include when managing the publication (create_publication); may be schema.table. Missing ones are added to an existing publication (never removed). Empty = FOR ALL TABLES (needs superuser).
slot_namestringnomq_bridge_slotReplication slot name; created if missing when create_slot is true.
source_metadatabooleannofalseInclude authoritative mqb.src.postgres_* source positions. Defaults to false.
split_key_changebooleanno—An update that changes the primary key becomes a delete of the old key, then the update.
status_interval_msintegerno10000Standby-status-update interval in ms; must be shorter than the server’s wal_sender_timeout.
temporary_slotbooleannofalseEphemeral run: drop the slot when the route stops. Not restart-safe; a hard crash leaks it.
tlsobjectnosee belowTLS configuration for the replication connection.
urlstringyes—Connection URL, e.g. postgres://user:pass@host:5432/dbname.

Struct-typed fields

publication_tables

[]

tls

TLS configuration for secure connections.

Configures Transport Layer Security (TLS/SSL) for encrypted communication. Supports both client certificate (mutual TLS) and server certificate validation.

Examples

use mq_bridge::models::TlsConfig;

let tls = TlsConfig {
    required: true,
    ca_file: Some("/path/to/ca.pem".to_string()),
    cert_file: Some("/path/to/cert.pem".to_string()),
    key_file: Some("/path/to/key.pem".to_string()),
    ..Default::default()
};
NameTypeRequiredDefaultDescription
accept_invalid_certsbooleannofalseIf true, disable server certificate verification (insecure).
ca_filestringno—Path to the CA certificate file.
cert_filestringno—Path to the client certificate file (PEM).
cert_passwordstringno—Password for the private key (if encrypted).
key_filestringno—Path to the client private key file (PEM).
requiredbooleannofalseIf true, enable TLS/SSL.