Home > front end >  Does replication slot in PostreSQL prevent deletion of WAL even they are from another database?
Does replication slot in PostreSQL prevent deletion of WAL even they are from another database?

Time:05-18

I have two databases on the same DB server. For the first of these DBs I have a publication and a slot for logical replication. In case many actions are be made with the second DB and the slot is "not active" (means nobody will get updates from the publication) - will the WAL's, connected to actions for the second DB, be stored and the slot size grow?

CodePudding user response:

Replication slots mark a certain position in the WAL stream, and all WAL information for the whole cluster is a single stream. So if you have a logical replication slot associated with database A, replication is stopped, and you generate a lot of WAL with activity in database B, all that WAL has to be retained, even if it does not contain any activity related to A.

Use different clusters to avoid that.

PS: a replication slot has no size.

  • Related