Re: pg_upgrade: Improve invalid option handling - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: pg_upgrade: Improve invalid option handling
Date
Msg-id CAD21AoAG5fKJBJZhdy=sz=0RW0NxjaJjTHYKe8wcmpt1Bz44Vw@mail.gmail.com
Whole thread Raw
In response to pg_upgrade: Improve invalid option handling  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: pg_upgrade: Improve invalid option handling
List 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



pgsql-hackers by date:

Previous
From:
Date:
Subject: RE: BEFORE UPDATE trigger on postgres_fdw table not work
Next
From: Dmitry Dolgov
Date:
Subject: Re: Improve handling of pg_stat_statements handling of bind "IN" variables