Re: pg_upgrade: Improve invalid option handling
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-18T08:25:44Z
Lists: pgsql-hackers
> On 18 Jun 2019, at 10:15, Michael Paquier <michael@paquier.xyz> 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);
>>
>> While we’re at it, should we change this to “could not open log file” to make
>> the messaging more consistent across the utilities (pg_basebackup and psql both
>> use “could not open”)?
>
> I would suggest "could not open file \"%s\": %s" instead with a proper
> strerror().
Correct, that matches how pg_basebackup and psql does it.
cheers ./daniel
Commits
-
pg_upgrade: Improve error messages
- cd917ffb9a43 12.0 landed
-
pg_upgrade: Improve invalid option handling
- aba78ab4a950 12.0 landed