How to determine the replication lag
When connected to a primary (or standby leader in case of cascaded replication), one can use pg_stat_replication:
When connected to a primary (or standby leader in case of cascaded replication), one can use pg_stat_replication:
Learn how to troubleshoot streaming replication lag