pg_walsummary
是一个用于打印 WAL 摘要文件内容的服务器实用程序。
pg_walsummary
添加于PostgreSQL 17。
示例
pg_walsummary
的基本用法示例,输出已截断为前几行以简洁起见
$ pg_walsummary /var/lib/pgsql/pg_wal/summaries/0000000100000000010B309800000000014EDA10.summary TS 1663, DB 1, REL 1247, FORK main: blocks 0..14 TS 1663, DB 1, REL 1247, FORK vm: block 0 TS 1663, DB 1, REL 1249, FORK main: blocks 0..57 TS 1663, DB 1, REL 1249, FORK vm: block 0 TS 1663, DB 1, REL 1255, FORK main: blocks 0..97 TS 1663, DB 1, REL 1255, FORK vm: block 0 ...
当提供 -i
/--individual
选项时
$ pg_walsummary -i /var/lib/pgsql/pg_wal/summaries/0000000100000000010B309800000000014EDA10.summary TS 1663, DB 1, REL 1247, FORK main: block 0 TS 1663, DB 1, REL 1247, FORK main: block 1 TS 1663, DB 1, REL 1247, FORK main: block 2 TS 1663, DB 1, REL 1247, FORK main: block 3 TS 1663, DB 1, REL 1247, FORK main: block 4 TS 1663, DB 1, REL 1247, FORK main: block 5 ...
尝试读取除 WAL 摘要文件以外的文件
$ pg_walsummary /var/lib/pgsql/pg_wal/000000010000000000000001 pg_walsummary: error: file "/var/lib/pgsql/pg_wal/000000010000000000000001" has wrong magic number: expected 1697321851, found 184596
参考
- PostgreSQL 17 文档: pg_walsummary