{"id":8982,"date":"2022-05-13T13:32:53","date_gmt":"2022-05-13T18:32:53","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8982"},"modified":"2022-05-16T20:50:12","modified_gmt":"2022-05-17T01:50:12","slug":"postgresql-replication-lag-2","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8982","title":{"rendered":"PostgreSQL Replication Lag &#8212; Distance between current and last confirmed flushed"},"content":{"rendered":"<p>Quick SQL command to report the delta between the current and confirmed flushed LSN&#8217;s:<\/p>\n<p><tt>SELECT slot_name, confirmed_flush_lsn, pg_current_wal_lsn(), (pg_current_wal_lsn() - confirmed_flush_lsn) AS lsn_distance<br \/>\nFROM pg_replication_slots<br \/>\nORDER BY slot_name;<\/tt><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8983\" rel=\"attachment wp-att-8983\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8983\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/05\/pg-lsn-distance.png\" alt=\"\" width=\"851\" height=\"252\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/05\/pg-lsn-distance.png 851w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/05\/pg-lsn-distance-300x89.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/05\/pg-lsn-distance-768x227.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/05\/pg-lsn-distance-750x222.png 750w\" sizes=\"auto, (max-width: 851px) 100vw, 851px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick SQL command to report the delta between the current and confirmed flushed LSN&#8217;s: SELECT slot_name, confirmed_flush_lsn, pg_current_wal_lsn(), (pg_current_wal_lsn() &#8211; confirmed_flush_lsn) AS lsn_distance FROM pg_replication_slots ORDER BY slot_name; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1522],"tags":[1348,1349,1580],"class_list":["post-8982","post","type-post","status-publish","format-standard","hentry","category-postgresql","tag-postgres","tag-postgresql","tag-postgresql-replication"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8982"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8982\/revisions"}],"predecessor-version":[{"id":8991,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8982\/revisions\/8991"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}