PostgreSQL stop streamig replication I've setup streaming replication between a master and a backup server. Now I want to stop the replication but I've noticed that every time I stop postgres in the backup server some old WALs files stay in the master server. 

My question, is there a safe way to stop replication and avoid master accumulating WALs file in the master ?
You'll have to drop the replication slot that is associated with the replication. Check the recovery configuration for the name.

Note that replication will break soon after you do that.