Re: [PATCH] add relation and block-level filtering to pg_waldump - Mailing list pgsql-hackers

From Japin Li
Subject Re: [PATCH] add relation and block-level filtering to pg_waldump
Date
Msg-id MEYP282MB166915697F54EB47877F6DB6B61A9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: [PATCH] add relation and block-level filtering to pg_waldump  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: [PATCH] add relation and block-level filtering to pg_waldump
List pgsql-hackers
On Fri, 25 Mar 2022 at 05:11, Thomas Munro <thomas.munro@gmail.com> wrote:
> Cool.
>
> I had another thought while changing that (and also re-alphabetising):
>  Why don't we switch to  -B for --block and -R for --relation?  I
> gather you used -k and -l because -b and -r were already taken, but
> since we already started using upper case for -F, it seems consistent
> this way.  Or were they chosen for consistency with something else?
>
> It's also slightly more helpful to a user if the help says
> --relation=T/D/R instead of N/N/N (TS/DB/REL would be nicer but
> doesn't fit in the space).

Thanks for updating the patch!

+       printf(_("  -x, --xid=XID          only show records with transaction ID XID\n"));

I think the description of transaction ID is enough, IIUC, XID is use in core,
which means transaction ID.

See: src/bin/pg_resetwal/pg_resetwal.c

1239     printf(_("  -V, --version                    output version information, then exit\n"));
1240     printf(_("  -x, --next-transaction-id=XID    set next transaction ID\n"));


+                               if (sscanf(optarg, "%u/%u/%u",
+                                                  &config.filter_by_relation.spcNode,
+                                                  &config.filter_by_relation.dbNode,
+                                                  &config.filter_by_relation.relNode) != 3 ||
+                                       !OidIsValid(config.filter_by_relation.spcNode) ||
+                                       !OidIsValid(config.filter_by_relation.relNode))

It seems we should also check the dbNode.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump new feature: exporting functions only. Bad or good idea ?
Next
From: Tom Lane
Date:
Subject: Re: Corruption during WAL replay