Re: pg_upgrade: Improve invalid option handling

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade: Improve invalid option handling
Date: 2019-06-13 12:30:34
Message-ID: CAD21AoAG5fKJBJZhdy=sz=0RW0NxjaJjTHYKe8wcmpt1Bz44Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 13, 2019 at 5:19 PM Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-06-13 13:06:46 Re: Improve handling of pg_stat_statements handling of bind "IN" variables
Previous Message shohei.mochizuki 2019-06-13 11:16:13 RE: BEFORE UPDATE trigger on postgres_fdw table not work