From b79b1aa0deab5e0607d6610d7bda0a4cdf26f26c Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 12 Sep 2021 10:28:44 +0200 Subject: [PATCH] pg_waldump example --- db.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/db.txt b/db.txt index 52a7fef..270de65 100644 --- a/db.txt +++ b/db.txt @@ -185,6 +185,9 @@ tar xvf /tmp/test-2021-09-11/pg_wal.tar.gz -C /tmp/r/pg_wal/ cp /var/lib/pgsql/10/recovery.conf /tmp/r/ vi /tmp/r/recovery.conf +restore_command = 'gunzip < /var/lib/pgsql/10/archive/%f > %p' + + cat postgresql.conf | grep -v archive_mode | grep -v archive_command > postgresql.conf.new && mv postgresql.conf.new postgresql.conf su postgres -c '/usr/pgsql-10/bin/pg_ctl -D /tmp/r start -o "-p 5433"' @@ -218,7 +221,17 @@ dpavlin=# SELECT pg_walfile_name(pg_current_wal_lsn()); 000000010000000000000021 (1 row) +## pg_waldump + +https://habr.com/en/company/postgrespro/blog/496150/ + +dpavlin=# SELECT pg_current_wal_insert_lsn(); + pg_current_wal_insert_lsn +--------------------------- + 0/25000140 +(1 row) +[root@slave pg_wal]# /usr/pgsql-10/bin/pg_waldump -p /var/lib/pgsql/10/data/pg_wal/ -s 0/25000140 # TODO -- 2.20.1