pg_walsummary

用于显示 WAL 摘要文件的实用程序

pg_walsummary 是一个用于打印 WAL 摘要文件内容的服务器实用程序

pg_walsummary 添加于PostgreSQL 17

用法

当提供单个 WAL 摘要文件的路径时,pg_walsummary 将解析它并将内容输出到 STDOUT

更改历史

示例

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

分类

开发/测试服务器实用程序WAL

另请参阅

pg_available_wal_summaries()pg_get_wal_summarizer_state()pg_wal_summary_contents()summarize_walwal_summary_keep_time

反馈

提交任何关于 "pg_walsummary" 的评论、建议或更正 此处