Hi hackers~ Recently when I was debugging with pg_waldump, I just want to filter out all the records about a specific relfilelocator, so I used -R T/D/R. I do get records like FPI, but not SMGR_CREATE / SMGR_TRUNCATE. Quick search of code tells me that pg_waldump would only keep records with block ref, while some WAL type does not have any block ref.
$ pg_waldump -R 1663/5/16398 000000010000000000000001 rmgr: XLOG len (rec/tot): 62/ 210, tx: 757, lsn: 0/40C20178, prev 0/40C20130, desc: FPI , blkref #0: rel 1663/5/16398 blk 0 FPW, blkref #1: rel 1663/5/16398 blk 1 FPW $ pg_waldump 000000010000000000000001 | grep 16398 rmgr: Storage len (rec/tot): 42/ 42, tx: 0, lsn: 0/40C1FBD0, prev 0/40C1FBA8, desc: CREATE base/5/16398 rmgr: Standby len (rec/tot): 42/ 42, tx: 757, lsn: 0/40C1FC38, prev 0/40C1FC00, desc: LOCK xid 757 db 5 rel 16398 rmgr: XLOG len (rec/tot): 62/ 210, tx: 757, lsn: 0/40C20178, prev 0/40C20130, desc: FPI , blkref #0: rel 1663/5/16398 blk 0 FPW, blkref #1: rel 1663/5/16398 blk 1 FPW rmgr: Transaction len (rec/tot): 274/ 274, tx: 757, lsn: 0/40C203D0, prev 0/40C20310, desc: COMMIT 2025-06-22 04:25:41.953683 UTC; ... It seems that -R is just a helper for -B. But since it can be used without -B, would it be better for pg_waldump to keep all WAL records about a rlocator no matter it has a block ref? It might be helpful for inspecting the whole life cycle of a rlocator. -- Regards, Jingtang