DBA Hub

📋Steps in this guide1/1

Monitor archiving progress

postgres# select pg_walfile_name(pg_current_wal_lsn()),last_archived_wal,last_failed_wal, ('x'||substring(pg_walfile_name(pg_current_wal_lsn()),9,8))::bit(32)::int*256 + ('x'||substring(pg_walfile_name(pg_current_wal_lsn()),17))::bit(32)::int - ('x'||substring(last_archived_wal,9,8))::bit(32)::int*256 - ('x'||substring(last_archived_wal,17))::bit(32)::int as diff from pg_stat_archiver;

postgresql configurationintermediate
by PostgreSQL
14 views
1

Monitor archiving progress

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
postgres#
select pg_walfile_name(pg_current_wal_lsn()),last_archived_wal,last_failed_wal,
('x'||substring(pg_walfile_name(pg_current_wal_lsn()),9,8))::bit(32)::int*256 +
('x'||substring(pg_walfile_name(pg_current_wal_lsn()),17))::bit(32)::int -
('x'||substring(last_archived_wal,9,8))::bit(32)::int*256 -
('x'||substring(last_archived_wal,17))::bit(32)::int
as diff from pg_stat_archiver;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!