2

I have set up PostgreSQL with streaming replication. It replicates very fast, in a fraction of a second. I'd like to insert a delay of 5, maybe 10, maybe 15 seconds, so that bugs related to replication manifest themselves clearly and developers can fix them. Is this possible?

Antonis Christofides
  • 2,598
  • 2
  • 23
  • 35

1 Answers1

1

I'd recommend solving this by using WAL archiving and replay instead of streaming replication. With a suitable archive_timeout this will give you a significant replication delays.

It isn't a great idea for production - it's better to use streaming replication with WAL archiving as a fallback - but I suspect it'd be very good for the testing requirements you have.

Craig Ringer
  • 11,083
  • 9
  • 40
  • 61