Re: Logical replication lag in seconds

2020-03-04 Thread Klaus Darilion
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

Re: Logical replication lag in seconds

2020-02-22 Thread Klaus Darilion
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

Re: Logical replication lag in seconds

2020-02-21 Thread 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, then we will be able to compute the lag.