Is there any way how I can clean up postgres WAL files ON MASTER SERVER - SLAVE is OK, but master has wal keep segment set to 2000 and this is causing disk space usage to grow. I'm looking for a way how to clean up that disk space on MASTER without breaking anything. I know that setting keep segments to 2000 is madness but that was not set by me.
Address the underlying cause and the problem will go away (your underlying problem being someone who didn't know what they were doing and didn't read the Postgres manual set
I was in a similar situation. After reducing
This will delete any logs older than the last checkpoint (what postgres is actively using).
You should also run it without the
(Solution based off info from http://blog.endpoint.com/2014/09/pgxlog-disk-space-problem-on-postgres.html)