Some code cleanup for pgbench and pg_verifybackup

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Some code cleanup for pgbench and pg_verifybackup
Дата
Msg-id YP5dtCVuVP6boi69@paquier.xyz
обсуждение исходный текст
Ответы Re: Some code cleanup for pgbench and pg_verifybackup
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Incorrect usage of strtol, atoi for non-numeric junk inputs
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg_upgrade don't echo windows commands