For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • Getting started
    • Introduction
    • IP Whitelisting
    • Obtaining API keys
    • LLMs.txt
    • MCP server
    • Quickstart
    • Native clients
    • Concepts
    • Embedding authentication
    • Versioning
    • Idempotent requests
    • Events
    • Self-hosted option
    • 2025-09-18 Migration Guide
  • Configuring your connections
    • Overview
    • CDC streaming from databases
    • Syncing to custom webhooks
  • Code examples
    • Overview
    • Bulk sync (ELT) from HubSpot to PostgreSQL
    • Bulk sync (ELT) from Salesforce to S3
    • Bulk sync (ELT) from Salesforce to Snowflake
    • Model sync (Reverse ETL) from Snowflake query to Salesforce
    • Model sync (Reverse ETL) from MongoDB to Salesforce
    • Adding users from Snowflake to Salesloft Cadence
    • Adding contacts from Snowflake to Gong Engage
    • Joined model sync from Postgres, Airtable, and Stripe to Hubspot
    • Model sync from MySQL to Snowflake
    • Model sync from Salesforce to Netsuite
    • Querying Salesforce using SOQL
    • Syncing audiences from Snowflake to LinkedIn Ads
    • Syncing contacts from Google Cloud Storage to Salesforce
    • Syncing contacts from Google Cloud Storage to webhooks
  • Terraform examples
    • Overview
    • Model sync (Reverse ETL) from BigQuery to Salesforce
    • Model sync (Reverse ETL) from BigQuery to LinkedIn Ads
Logo
Log inBook a demo
On this page
  • PostgreSQL
  • Set your Polytomic PostgreSQL connection configuration
  • MySQL
  • Set your Polytomic MySQL connection configuration
Configuring your connections

CDC streaming from databases

Was this page helpful?
Previous

Syncing to custom webhooks

Next

When syncing untransformed data from PostgreSQL or MySQL into a data warehouse, database, or cloud storage, it’s preferred (though not required) for Polytomic to utilize CDC (change data capture) replication. This will avoid Polytomic running table scans to figure out changes since the last sync. Rather, Polytomic will process changes in real-time without scanning source tables.

This section covers setup instructions to enable this on PostgreSQL and MySQL.

PostgreSQL
MySQL

PostgreSQL

To enable CDC streaming from PostgreSQL, Polytomic requires the following of the PostgreSQL instance:

  • PostgreSQL 10 or later (Polytomic uses the pgoutput plugin).
  • Set the PostgreSQL wal_level setting to logical.

You can determine the value of the wal_level setting by running this query:

my_database=> show wal_level;
wal_level
-----------
logical
(1 row)
  • Set the PostgreSQL wal_sender_timeout setting to five minutes.
  • Available replication slot.

Polytomic requires a replication slot for each bulk sync; the same slot will be used for all tables synced as part of that bulk sync configuration. The total number of replication slots is set using the max_replication_slots PostgreSQL setting.

You can inspect current replication slots using the pg_replication_slots system table:

1select * from pg_replication_slots;
  • User with REPLICATION property set.

The REPLICATION property signals that a PostgreSQL user (role) is able to manage replication slots. Polytomic will use this property to create a replication slot for each bulk sync configured. You can set it with the following query:

1ALTER ROLE polytomic_user WITH REPLICATION;
  • A publication for the tables you wish to replicate.

PostgreSQL uses a publication to track changes to one or more tables. Only a user with the owner role for a table may add it to the publication. After the publication is created, however, any user with the REPLICATION property may use it.

You can create a publication for specific tables or for all tables (including those created in the future). Note that creating a publication for all tables may result in increased storage consumption.

The publication name can be anything; you’ll enter it in Polytomic’s PostgreSQL connection configuration.

1-- Create a publication for specific tables
2CREATE PUBLICATION polytomic FOR TABLE <table>, <table>, ...;
3
4-- Create a publication for all current and future tables
5CREATE PUBLICATION polytomic FOR ALL TABLES;

Set your Polytomic PostgreSQL connection configuration

Once the previous steps are done, be sure to set the following arguments in Polytomic’s PostgreSQL connection configuration:

  • change_detection: true
  • publication: the name of the publication generated in the previous section