Book Image

PostgreSQL Replication, Second Edition

Book Image

PostgreSQL Replication, Second Edition

Overview of this book

Table of Contents (22 chapters)
PostgreSQL Replication Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Controlling replication


For maintenance reasons, it might be necessary to hold and resume replication from time to time. Just imagine a major software update. It might do something nasty to your data structure. You definitely don't want faulty stuff to be replicated to your entire system. Therefore, it can come in handy to stop replication briefly and restart it once things have proven to be fine.

Two functions are available for this job:

SELECT bdr.bdr_apply_pause()

To restart things again, the following procedure can be used:

SELECT bdr.bdr_apply_resume()

Connections to the remote node (or nodes) are retained, but no data is read from them. The effects of pausing apply are not persistent, so the replay will resume if PostgreSQL is restarted or the postmaster carries out crash recovery after a backend crash. Terminating individual backend using pg_terminate_backend will not cause a replay to resume, nor will reloading the postmaster, without a full restart. There is no option to pause a...