Re: Teach pg_upgrade to deal with invalid databases

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Rithvika Devisetti <devisettirithvika(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(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-08 17:11:23
Message-ID: CALj2ACWo_iCxmVcumiqX2O=hr5AYknfrqeExGQAJji-mY2xJnQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Sep 7, 2026 at 11:22 PM Rithvika Devisetti
<devisettirithvika(at)gmail(dot)com> wrote:
>
> It looks like you and Nathan now agree that pg_upgrade should always
> skip invalid databases, without any option.

pg_upgrade dropping the invalid databases does NOT seem like the right
approach. I am clear on this unless anyone thinks otherwise.

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 will give it some more time to hear from others.

> Because of that, I did not
> test v1. i think testing it now would not be very useful.
>
> When you post the updated patch, I would like to test these three
> things from your last message, since I don't think anyone has checked
> them yet:
>
> - In link mode, the skipped database's files should not appear
> anywhere in the new cluster.
> - The delete script that pg_upgrade creates should also remove the
> skipped database's old files.
> - In copy mode, the old cluster should stay exactly the same, so it
> can still be used as a backup.

Thanks for offering to verify these cases. You can still test with v1
using --invalid-databases=skip.

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-09-08 17:13:57 Re: convert various variables to atomics
Previous Message Nathan Bossart 2026-09-08 17:00:47 Re: convert various variables to atomics