Some code cleanup for pgbench and pg_verifybackup
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-26T07:01:08Z
Lists: pgsql-hackers
Attachments
- pgbench-verifybackup-cleanups.patch (text/x-diff) patch
Hi all, While looking at the code areas of $subject, I got surprised about a couple of things: - pgbench has its own parsing routines for int64 and double, with an option to skip errors. That's not surprising in itself, but, for strtodouble(), errorOK is always true, meaning that the error strings are dead. For strtoint64(), errorOK is false only when parsing a Variable, where a second error string is generated. I don't really think that we need to be that pedantic about the type of errors generated in those code paths when failing to parse a variable, so I'd like to propose a simplification of the code where we reuse the same error message as for double, cutting a bit the number of translatable strings. - pgbench and pg_verifybackup make use of pg_log_fatal() to report some failures in code paths dedicated to command-line options, which is inconsistent with all the other tools that use pg_log_error(). Please find attached a patch to clean up all those inconsistencies. Thoughts? -- Michael
Commits
-
Add some missing exit() calls in error paths for various binaries
- 856de3b39cf6 15.0 landed
-
Add missing exit() in pg_verifybackup when failing to find pg_waldump
- efe169c90090 13.4 landed
- 67445deb7eca 14.0 landed
- 2ad98fdf53ed 15.0 landed