Skip to content

Setup

  • Ensure Postgres database user is a superuser (this is required to query replication slots)
     SELECT usename FROM pg_user WHERE usesuper = true
    
  • Enable logical decoding in postgres.conf
wal_level = logical
  • Ensure there is at least one replication slot defined in postgres.conf
    max_replication_slots = 1
    
  • Ensure Postgres database user is a superuser
    GRANT rds_superuser TO <username>
    
  • Enable logical_replication by using the parameter group settings described here

Info

To prevent your server logs from growing too large e.g when running on cloud infrastructure where there is a cost implication. You can optionally impose a ceiling on the replication slot size using max_slot_wal_keep_size

max_slot_wal_keep_size = 100GB