Re: Teach pg_upgrade to deal with invalid databases

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Rithvika Devisetti <devisettirithvika(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Treat <rob(at)xzilla(dot)net>
Subject: Re: Teach pg_upgrade to deal with invalid databases
Date: 2026-09-21 19:01:09
Message-ID: arF-9cZQwDcvG07U@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 08, 2026 at 10:11:23AM -0700, Bharath Rupireddy wrote:
> pg_upgrade skipping the invalid databases seems like the right
> approach. Whether or not this has to be put behind an option and
> retain the current error behavior is something we need to agree on. I
> still think pg_upgrade can just skip and the error could be removed,
> unless anyone thinks otherwise.

I think we ought to simply skip the invalid databases without any sort of
option. The only counterargument I'm aware of is that someone might want
to try recoving the database, but AFAIK there's no supported recovery
mechanism. Even if there was, it seems pretty unlikely that a user would
cancel an errant DROP DATABASE and then proceed to run pg_upgrade before
attempting recovery. Furthermore, I believe the proposed skipping behavior
more closely matches the previous behavior before we started using
datconnlimit == -2 to mean the database is invalid.

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-09-21 19:51:26 Adding a range check on the sequence index from the publisher.
Previous Message Andres Freund 2026-09-21 18:58:25 Re: Severe performance degradation with concurrent updates due to excessive EvalPlanQual (EPQ) re‑evaluation