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

From Daniel Gustafsson
Subject Re: pg_upgrade: Improve invalid option handling
Date
Msg-id 675558AD-B58A-402A-A73A-DE9B0FF139FE@yesql.se
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 13 Jun 2019, at 10:19, 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.

+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


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Add CREATE DATABASE LOCALE option
Next
From: Amit Kapila
Date:
Subject: Re: POC: Cleaning up orphaned files using undo logs