CDC Sink for PostgreSQL: WAL Configuration
-
CDC Sink uses PostgreSQL logical replication, which requires
wal_levelto be set tological. -
This page explains how to check the current
wal_level, enable logical replication if needed,
and review related replication settings. -
In this article:
Check current WAL level
Connect to your PostgreSQL instance and run:
- SQL
SHOW wal_level;
If the result is logical, no change to wal_level is needed.
If the result is replica or minimal,
logical replication is not enabled and wal_level must be changed before CDC Sink can read changes from PostgreSQL.
Enable logical replication
For self-managed PostgreSQL, edit postgresql.conf and set:
wal_level = logical
Changing wal_level requires a full server restart, not just a configuration reload.
Plan for a brief maintenance window.
After restarting, verify the change took effect:
- SQL
SHOW wal_level;
-- Should return: logical
Managed PostgreSQL
On managed PostgreSQL services, you usually cannot edit postgresql.conf directly.
Change the setting through the provider's configuration mechanism instead:
-
Amazon RDS for PostgreSQL
Setrds.logical_replication = 1in the DB parameter group, then reboot the DB instance. -
Amazon Aurora PostgreSQL
Setrds.logical_replication = 1in the DB cluster parameter group, then reboot the writer instance. -
Google Cloud SQL for PostgreSQL
Set thecloudsql.logical_decodingflag toon, then restart the primary instance. -
Azure Database for PostgreSQL Flexible Server
Set thewal_levelserver parameter tological, save the change, and restart the server.
Other required settings
CDC Sink uses one PostgreSQL replication slot per task.
Make sure the following settings are high enough for your CDC Sink tasks and any other replication consumers:
max_replication_slots = 10 # at least 1 per CDC Sink task
max_wal_senders = 10 # at least 1 per running CDC Sink task
The defaults in a standard PostgreSQL installation are typically sufficient for a small number of tasks,
but you may need to increase them if you have many CDC Sink tasks or other replication consumers.
Check current values:
- SQL
SHOW max_replication_slots;
SHOW max_wal_senders;
These settings require a server restart if changed.