Re: pg_upgrade: Improve invalid option handling
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-13T12:30:34Z
Lists: pgsql-hackers
On Thu, Jun 13, 2019 at 5:19 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
>
> Currently, calling pg_upgrade with an invalid command-line option aborts
> pg_upgrade but leaves a pg_upgrade_internal.log file lying around. This
> patch reorder things a bit so that that file is not created until all
> the options have been parsed.
>
- pg_fatal("Try \"%s --help\" for more
information.\n",
- os_info.progname);
- break;
+ fprintf(stderr, _("Try \"%s --help\"
for more information.\n"),
+ os_info.progname);
+ exit(1);
Why do we need to change pg_fatal() to fprintf() & exit()? It seems to
me that we can still use pg_fatal() here since we write the message to
stderr.
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
Commits
-
pg_upgrade: Improve error messages
- cd917ffb9a43 12.0 landed
-
pg_upgrade: Improve invalid option handling
- aba78ab4a950 12.0 landed