For the records - with a simple script I hacked a solution which is
purely based on the server.
1. Create a table to track the timestamp of an lsn:
CREATE TABLE lsn2date(
lsn pg_lsn PRIMARY KEY,
seen timestamp NOT NULL DEFAULT NOW()
);
CREATE ROLE replication_lag_user WITH LOGIN PASSWORD 'x
Hi Michael!
Am 21.02.2020 um 21:24 schrieb Michael Lewis:
I am very interested in this discussion. We settled a table with a
single timestamp field that a script updates every minute with NOW() so
that we can check the timestamp of that table on the replica, assuming
the clocks are synced, the
I am very interested in this discussion. We settled a table with a single
timestamp field that a script updates every minute with NOW() so that we
can check the timestamp of that table on the replica, assuming the clocks
are synced, then we will be able to compute the lag.