Setup¶
1. Ensure database user is a superuser (required to query replication slots):
2. Enable logical decoding in postgres.conf:
3. Configure replication slots in postgres.conf:
Restart Required
After changing postgres.conf, restart PostgreSQL for changes to take effect.
1. Grant superuser privileges:
2. Enable logical replication via parameter groups. See AWS documentation.
Prevent Log Growth
On cloud infrastructure, replication slots can cause WAL logs to grow indefinitely. Set a ceiling using max_slot_wal_keep_size: