Set up a self-hosted PostgreSQL database
How to set up a self-hosted PostgreSQL database as a source for RisingWave.
To connect RisingWave to a self-hosted PostgreSQL database for Change Data Capture (CDC), you need to configure your database to support logical replication.
1. Set wal_level
to logical
In your postgresql.conf
file or via a SQL client, set the wal_level
parameter to logical
.
This change requires a restart of your PostgreSQL server to take effect.
If you plan to create multiple CDC sources, ensure the max_wal_senders
parameter in your postgresql.conf
is greater than or equal to the number of sources you intend to create. The default value is typically 10.
2. Create a dedicated replication user
Create a dedicated PostgreSQL user for replication. This user needs the REPLICATION
and LOGIN
attributes.
3. Grant required privileges
Grant the user the necessary privileges on the database and schemas you want to capture changes from.
Next step
Now that your database is configured, you can proceed to connect RisingWave.