---
title: "CDC Sink for PostgreSQL: WAL Configuration"
description: "How to verify and configure the PostgreSQL Write-Ahead Log level to enable logical replication required by CDC Sink."
url: "https://docs.ravendb.net/7.2/server/ongoing-tasks/cdc-sink/source-database-setup/postgres/wal-configuration"
version: "7.2"
---

# CDC Sink for PostgreSQL: WAL Configuration

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

> **Note**
>
> - CDC Sink uses PostgreSQL **logical replication**, which requires `wal_level` to be set to `logical`.
>
> - 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](#check-current-wal-level)
>   - [Enable logical replication](#enable-logical-replication)
>   - [Other required settings](#other-required-settings)

## Check current WAL level {#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 {#enable-logical-replication}

For self-managed PostgreSQL, edit `postgresql.conf` and set:

```text
wal_level = logical
```

> **Warning**
>
> 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
```

> **Info**
>
> #### 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 {#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:

```text
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.

## See also

- [Prerequisites Checklist](https://docs.ravendb.net/7.2/server/ongoing-tasks/cdc-sink/source-database-setup/postgres/prerequisites-checklist.md)
- [Permissions and Roles](https://docs.ravendb.net/7.2/server/ongoing-tasks/cdc-sink/source-database-setup/postgres/permissions-and-roles.md)
- [Cleanup and Maintenance](https://docs.ravendb.net/7.2/server/ongoing-tasks/cdc-sink/source-database-setup/postgres/cleanup-and-maintenance.md)
