I've had success in the past with MySQL's delayed replication feature which allows you to stop replication, inspect the bin log to find a bad query and SLAVE UNTIL
just before said query and skip over it.
Since Postgresql introduced the min_recovery_apply_delay
setting I was hoping to achieve the same thing in Postgres, however, I keep reading articles which stop at the point at which you stop replication. So now you have data x hours old... how do you get back up and running? A guide similar to what I wrote for MySQL would be ideal
Edit: from a lot of searching around I've found the omnipitr and pghoard tools along with the recovery target settings. In particular the recovery_target_xid
setting which will allow me to recover to an exact query. The only missing piece of the puzzle now is I'm not sure how to tell postgresql to skip this bad query and continue recovery after that point.