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.

Logical replication lag in seconds

2020-02-21 Thread Klaus Darilion
Hello! I currently use Slony for replication and want to switch to logical replication. With Slony I was aware of the replication lag of each slave in seconds. This info was available regardless if a slave was online or offline. For my application I need to know the "delay" of all replicas, wethe