I’m getting: - - - pg_dump: error: Error message from server: ERROR: canceling statement due to conflict with recovery ClientBeforeJob: DETAIL: User was holding a relation lock for too long - - - I have a 3-level streaming replication setup: primary -> standby1 -> standby2 standby2 is for backup only and shows above error. Both standbys have hot_standby_feedback = on Nvertheless the error happens. Why? How can I fix it?
Pause recovery on standby2 with pg_wal_replay_pause(), run pg_dump, and then resume recovery with pg_wal_replay_resume().