Skip to main content

CDC Sink for PostgreSQL: WAL Configuration

Check current WAL level​

Connect to your PostgreSQL instance and run:

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:

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
    Set rds.logical_replication = 1 in the DB parameter group, then reboot the DB instance.

  • Amazon Aurora PostgreSQL
    Set rds.logical_replication = 1 in the DB cluster parameter group, then reboot the writer instance.

  • Google Cloud SQL for PostgreSQL
    Set the cloudsql.logical_decoding flag to on, then restart the primary instance.

  • Azure Database for PostgreSQL Flexible Server
    Set the wal_level server parameter to logical, 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:

SHOW max_replication_slots;
SHOW max_wal_senders;

These settings require a server restart if changed.

In this article