> I suggest that in PG12 you can monitor the >> "lag" of a standby server more directly by looking at columns write_lag, >> flush_lag, replay_lag in the pg_stat_replication view. > > > And are those things updated when there are no changes to the master > database? > If so, can anyone make the case that continually checking and updating > them (how often?) wastes fewer electrons than shipping an empty file every > few minutes? > > Or are they only measured when something is updated? >
If you setup a scripted process to update a single row with a timestamptz on the source/primary every minute, then you have a very simple consistent change and also a way to check on the replica what is current time vs last_scripted_update_time if you will and know the approx lag. It would seem like a simple albeit hacky solution to you wanting a file every X minutes regardless of server activity. By the by, top-posting (reply above all quoted text) is discouraged on these groups.