Re: BUG #19928: pg_upgrade fails on v18 schema with NOT NULL ... NO INHERIT and inheritance

From: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Raja Sai pranav <rajasaipranav0(at)gmail(dot)com>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19928: pg_upgrade fails on v18 schema with NOT NULL ... NO INHERIT and inheritance
Date: 2026-11-26 12:56:28
Message-ID: awgq2Rih_F_2AvRJ@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2026-Nov-26, Raja Sai pranav wrote:

> Yes, thanks. I reproduced it: a master pg_dump of this schema from 18.7
> fails to restore into master with the same error. It doesn't need
> pg_upgrade or an older server, though: creating the schema on master
> and doing a plain pg_dump / psql restore into another master database
> fails the same way.
>
> pg_dump emits both NOT VALID constraints as separate ALTER TABLE ... ADD
> CONSTRAINT commands after the data, parent first. Adding "nn" to the
> parent recurses and gives the child an inherited constraint named "nn",
> so the child's own command then fails the name check added by 96e2af605.

Interesting.

> I'll look into a fix, unless Álvaro would rather handle it.

Please go ahead.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Álvaro Herrera 2026-11-26 12:45:23 Re: reltuples kept decreasing with each autovacuum run Re: BUG #18773