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_storestringnoCheckpoint store spec (e.g. file:///path, s3://bucket/prefix); defaults to the source database.
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_idstringnoCheckpoint key for persisting the confirmed LSN across restarts (optional; the slot is authoritative).
publicationstringyesPublication 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.
status_interval_msintegerno10000Standby-status-update interval in ms; must be shorter than the server’s wal_sender_timeout.
temporary_slotbooleannofalseUse a temporary slot (dropped on disconnect). Not restart-safe; default is a permanent slot.
tlsobjectnosee belowTLS configuration for the replication connection.
urlstringyesConnection 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_filestringnoPath to the CA certificate file.
cert_filestringnoPath to the client certificate file (PEM).
cert_passwordstringnoPassword for the private key (if encrypted).
key_filestringnoPath to the client private key file (PEM).
requiredbooleannofalseIf true, enable TLS/SSL.