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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: andrewbille(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases
Date: 2025-10-06 03:42:06
Message-ID: CAFiTN-uGjaRsonvm7VBNXFUVFvpmeCZmAb1_-=XhiPv-=7S0kQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Oct 5, 2025 at 3:22 PM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference: 19074
> Logged by: Andrew Bille
> Email address: andrewbille(at)gmail(dot)com
> PostgreSQL version: 18.0
> Operating system: Ubuntu 20.04
> Description:
>
> Hello.
>
> In 17.6, we're creating tables:
>
> CREATE TABLE p (a integer);
> CREATE TABLE c () INHERITS (p);
> ALTER TABLE ONLY c ALTER COLUMN a SET NOT NULL;
>
> 17/bin/pg_dump test returns:
>
> ....
> CREATE TABLE public.p (
> a integer
> );
>
> ALTER TABLE public.p OWNER TO andrew;
>
> --
> -- Name: c; Type: TABLE; Schema: public; Owner: andrew
> --
>
> CREATE TABLE public.c (
> )
> INHERITS (public.p);
> ALTER TABLE ONLY public.c ALTER COLUMN a SET NOT NULL;
> ....
>
>
> REL_18_0, REL_18_STABLE, master
> master/bin/pg_dump test produces:
>

I tried to reproduce this, but here is what I see[1] when I dump in
REL_18_STABLE, I noticed that "NOT NULL a" for inherited tables is
included along with the create table statement itself, so this doesn't
seems like an issue, am I missing something?

[1]
CREATE TABLE public.p (
a integer
);

ALTER TABLE public.p OWNER TO dilipkumarb;

--
-- Name: c; Type: TABLE; Schema: public; Owner: dilipkumarb
--

CREATE TABLE public.c (
NOT NULL a
)
INHERITS (public.p);

ALTER TABLE public.c OWNER TO dilipkumarb;

--
Regards,
Dilip Kumar
Google

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2025-10-06 03:59:09 Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases
Previous Message Michael Paquier 2025-10-06 03:37:21 Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c