Re: pg_upgrade check for invalid databases - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: pg_upgrade check for invalid databases
Date
Msg-id ZwQ-xtmKbNAz_HK8@nathan
Whole thread Raw
In response to Re: pg_upgrade check for invalid databases  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_upgrade check for invalid databases
List pgsql-hackers
On Mon, Oct 07, 2024 at 03:37:35PM -0400, Bruce Momjian wrote:
> On Tue, Oct  1, 2024 at 09:28:54AM +0200, Daniel Gustafsson wrote:
>> Correct, sorry for being unclear.  The consistency argument would be to expand
>> pg_upgrade to report all invalid databases rather than just the first found;
>> attempting to fix problems would be a new behavior.
> 
> Yes, historically pg_upgrade will fail if it finds anything unusual,
> mostly because what it does normally is already scary enough.  If users
> what pg_upgrade to do cleanups, it would be enabled by a separate flag,
> or even a new command-line app.

While I suspect it's rare that someone CTRL-C's out of an accidental DROP
DATABASE and then runs pg_upgrade before trying to recover the data, I
agree with the principle of having pg_upgrade fail by default for things
like this.  If we did add a new flag, the new invalid database report that
Daniel mentions could say something like "try again with
--skip-invalid-databases to have pg_upgrade automatically drop invalid
databases."

-- 
nathan



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Doc: typo in config.sgml
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Add trim_trailing_whitespace to editorconfig file