Re: pg_upgrade: Improve invalid option handling

2019-06-19 Thread Daniel Gustafsson
> On 19 Jun 2019, at 21:51, Peter Eisentraut > wrote: > > On 2019-06-19 04:24, Michael Paquier wrote: >> On Tue, Jun 18, 2019 at 10:25:44AM +0200, Daniel Gustafsson wrote: >>> Correct, that matches how pg_basebackup and psql does it. >> >> Perhaps you have a patch at hand? I can see four strin

Re: pg_upgrade: Improve invalid option handling

2019-06-19 Thread Peter Eisentraut
On 2019-06-19 04:24, Michael Paquier wrote: > On Tue, Jun 18, 2019 at 10:25:44AM +0200, Daniel Gustafsson wrote: >> Correct, that matches how pg_basebackup and psql does it. > > Perhaps you have a patch at hand? I can see four strings in > pg_upgrade, two in exec.c and two in option.c, which coul

Re: pg_upgrade: Improve invalid option handling

2019-06-18 Thread Michael Paquier
On Tue, Jun 18, 2019 at 10:25:44AM +0200, Daniel Gustafsson wrote: > Correct, that matches how pg_basebackup and psql does it. Perhaps you have a patch at hand? I can see four strings in pg_upgrade, two in exec.c and two in option.c, which could be improved. -- Michael signature.asc Description

Re: pg_upgrade: Improve invalid option handling

2019-06-18 Thread Daniel Gustafsson
> On 18 Jun 2019, at 10:15, Michael Paquier wrote: > > On Fri, Jun 14, 2019 at 12:34:36PM +0200, Daniel Gustafsson wrote: >> +if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL) >> +pg_fatal("could not write to log file \"%s\"\n", >> INTERNAL_LOG_FILE); >> >> W

Re: pg_upgrade: Improve invalid option handling

2019-06-18 Thread Michael Paquier
On Fri, Jun 14, 2019 at 12:34:36PM +0200, Daniel Gustafsson wrote: > + if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL) > + pg_fatal("could not write to log file \"%s\"\n", > INTERNAL_LOG_FILE); > > While we’re at it, should we change this to “could not open l

Re: pg_upgrade: Improve invalid option handling

2019-06-14 Thread Daniel Gustafsson
> On 13 Jun 2019, at 10:19, Peter Eisentraut > 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 b

Re: pg_upgrade: Improve invalid option handling

2019-06-14 Thread Peter Eisentraut
On 2019-06-13 14:30, Masahiko Sawada wrote: > 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. It just makes the output more consistent with other tools, e.g., old: pg_upgrade: unrecognized o

Re: pg_upgrade: Improve invalid option handling

2019-06-13 Thread Masahiko Sawada
On Thu, Jun 13, 2019 at 5:19 PM Peter Eisentraut 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

pg_upgrade: Improve invalid option handling

2019-06-13 Thread Peter Eisentraut
.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services From 69a1f9259c025fc38280b41ced25571feeb90ef8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 13 Jun 2019 10:12:34 +0200 Subject: [PATCH] pg_upgrade: Improve invalid option handling Currently, cal