Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases

Andrew Bille <andrewbille@gmail.com>

From: Andrew Bille <andrewbille@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>, David Rowley <dgrowleyml@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2025-10-17T07:05:51Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix determination of not-null constraint "locality" for inherited columns

  2. Fix pg_dump sorting of foreign key constraints

  3. Sort dump objects independent of OIDs, for the 7 holdout object types.

  4. Add pg_constraint rows for not-null constraints

Looks good for me. I checked it on my enhanced upgrade test.

Thanks.

Regards,
Andrew

On Mon, Oct 6, 2025 at 7:04 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:

> I think we can fix it in getTableAttrs(), see attached, with that I
> can see my dump is correct.  This is just a quick way to show what I
> am thinking, maybe we can improve this condition.  I believe
> flagInhAttrs() is more about resetting the "notnull_islocal" if any of
> the parent already has it as non null.  This fix is working with this
> basic case, but I haven't investigated whether it will work in all
> cases or is it breaking anything.
>
> --
> Regards,
> Dilip Kumar
> Google
>