Re: Pg upgrade bug with NOT NULL NOT VALID - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: Pg upgrade bug with NOT NULL NOT VALID
Date
Msg-id ahGZu3rmU2zmCWHq@alvherre.pgsql
Whole thread
In response to pgsql: Fix EXCEPT publication test to check subscriber  (Fujii Masao <fujii@postgresql.org>)
List pgsql-hackers
On 2026-May-23, Kirill Reshke wrote:

> On Thu, 21 May 2026 at 22:18, Álvaro Herrera <alvherre@kurilemu.de> wrote:

> > I see two alternatives.  One is to have pg_dump --binary-upgrade choose
> > a constraint name for the not-null with full knowledge of all other
> > constraint names, so that we know to generate a non conflicting one.
> > I suspect this is not easy to code.
> 
> Well, for this option, we need to be told about what other constraint
> names that are about to be created.

Sure.  Of course, pg_dump can run all the queries it needs to obtain
constraint names, so it's certainly doable.

> > The other is much simpler: make pg_upgrade -c warn you about the check
> > constraint name so that you know to rename it before the upgrade.
> 
> I don't think this is good when the database asks you to change your
> DDL because of its internal troubles with something.

OK.  I disagree but I'm not opposed if you want to do it the other way.

If you prefer that I write the patch, that's fine too.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La espina, desde que nace, ya pincha" (Proverbio africano)



pgsql-hackers by date:

Previous
From: Yushu Chen
Date:
Subject: [PATCH] Add regression test for mismatched ENCODING and LOCALE in CREATE DATABASE
Next
From: Daniil Davydov
Date:
Subject: ERROR during COMMIT PREPARED can leave orphaned locks