Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: andrewbille@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2025-10-06T03:42:06Z
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 →
-
Fix determination of not-null constraint "locality" for inherited columns
- c945b06d5f03 17.7 landed
- 615ff828e1cb 19 (unreleased) landed
- 0fe07fa115f5 18.1 landed
-
Fix pg_dump sorting of foreign key constraints
- d20df9590aef 13.23 landed
- 7419c99a25fb 17.7 landed
- 6062c3db3093 14.20 landed
- 4cc3b4445913 15.15 landed
- 4921a5972a34 19 (unreleased) landed
- 162e70ea06eb 18.1 landed
- 06c1ee6b75dc 16.11 landed
-
Sort dump objects independent of OIDs, for the 7 holdout object types.
- 0decd5e89db9 19 (unreleased) cited
-
Add pg_constraint rows for not-null constraints
- 14e87ffa5c54 18.0 cited
On Sun, Oct 5, 2025 at 3:22 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference: 19074
> Logged by: Andrew Bille
> Email address: andrewbille@gmail.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