Re: pg_upgrade: Improve invalid option handling

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
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-14 10:34:36
Message-ID: 675558AD-B58A-402A-A73A-DE9B0FF139FE@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 13 Jun 2019, at 10:19, 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.

+1 on doing this.

+ 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”)?

cheers ./daniel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-06-14 10:46:46 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Heikki Linnakangas 2019-06-14 09:57:58 Re: Add CREATE DATABASE LOCALE option