Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a streaming replication running between two servers.

I just upgraded to postgresql 9.3 from 9.2. Earlier on in my 9.2 setup, I have tried that my slave server went offline due to a network outage. This resulted in unshipped wal-log files building up and taking up space VERY fast on my master server.

Can I prevent this in an easy way in 9.3?

I have seen the new wal_sender_timeout config, but I am unsure what exactly it does?

What's the best way of preventing wal-files from building up on sender if receiver goes offline in 9.3?

share|improve this question
What's your archive_command doing? – Craig Ringer Feb 26 '14 at 11:22
up vote 3 down vote accepted

Set wal_keep_segments to a low enough value that WAL will be discarded before pg_xlog fills up.

If you're also using WAL archiving with an archive_command, Pg will keep on trying until it successfully sends the WAL or runs out of space. Don't have your master copy the WAL directly to the replica; instead put it on some reliable high availability storage that the replica also has access to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.