Disclaimer: I admittedly haven't tried this yet, but I'm not sure I would know if it wasn't working correctly, so I wanted to ask.
I would like to run a nightly backup job (via pg_dumpall
) from a hot standby server running streaming replication, to avoid putting that load on the primary. I've only seen mention of some gotchas people have run into, e.g. here and here, but very little guidance. It's okay if the backup lags behind the primary slightly, as long as it's consistent (which it should be).
My questions are:
Do I really want to do this, or should the backup be done on the primary server? Why?
When doing a dump on the standby, what settings do I need and procedure should I use to do that correctly? e.g. must I stop replication for the duration of the backup?
pg_dump
documentation states: "It makes consistent backups even if the database is being used concurrently."pg_dumpall
runs the former for each database.