Re: persevere NO INHERIT when Dump not-null constraints on inherited columns

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: persevere NO INHERIT when Dump not-null constraints on inherited columns
Date: 2026-02-26 12:19:11
Message-ID: CAExHW5tA6=iLuxTyWf7RYFkBGjTCLuiO1zsx_YDa03DSbcBH6Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 26, 2026 at 4:22 PM Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> On 2026-Feb-25, Álvaro Herrera wrote:
>
> > On 2026-Feb-25, Álvaro Herrera wrote:
> >
> > > Ugh, you're right, this is broken and your patch fixes it.
> > >
> > > I'm gonna write a quick test case for this and push as soon as I'm able.
> >
> > Here it is.
>
> Pushed. I also added a test for the standard case of NO INHERIT in a
> not-null constraint.
>
> Thanks for reporting this.

This could have been caught by 002_pg_upgrade's regression
dump/restore test, if we had a NO INHERIT on child being tested in
regression test and not dropped. I browsed through regression tests
testing NO INHERIT. I found some adding NO INHERIT check constraint on
child table but no NOT NULL constraint on child table. But I didn't
look very closely. If that's true, we may not have enough coverage to
check whether NO INHERIT on a child table is honoured or not when a
grandchild is added. I did find a test which tests that NO INHERIT NOT
NULL on the child table is not merged with normal NOT NULL constraint.

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-02-26 12:19:25 Re: Adding REPACK [concurrently]
Previous Message Ashutosh Bapat 2026-02-26 12:02:38 Re: doc: Clarify that empty COMMENT string removes the comment