This is my first try to post on that list to propose a workaround on an issue I noticed while using pg_waldump. Each time an object is referenced by "oids" following output template :
tablespace oid/database oid/relfilenodeid
That template seems to be used for each operation but the *copy dir* operation. The latter is performed (at least) when CREATE DATABASE statement is called with the template: oid/tablespace oid
Exemple on CREATE DATABASE (without defining a template database) : rmgr: Database len (rec/tot): 42/ 42, tx: 568, lsn: 0/01865790, prev 0/01865720, desc: CREATE copy dir 1/1663 to 16384/1663
It comes out (to me) it may be more consistent to use the same template than the other operations in pg_waldump. I propose to swap the parameters positions for the copy dir operation output.
You'll find a patch file included which does the switching job : rmgr: Database len (rec/tot): 42/ 42, tx: 568, lsn: 0/01865790, prev 0/01865720, desc: CREATE copy dir 1663/1 to 1663/16384