pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: andrewbille@gmail.com
Subject: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases
Date: Sun, 05 Oct 2025 05:20:21 +0000
Message-ID: <19074-ae2548458cf0195c@postgresql.org> (raw)

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:

...
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 public.c OWNER TO andrew;

--
-- Data for Name: c; Type: TABLE DATA; Schema: public; Owner: Andrew
--

COPY public.c (a) FROM stdin;
\.
...

and loses NOT NULL in the inherited table

Regards, Andrew



view thread (12+ messages)  latest in thread

Message-ID: <19074-ae2548458cf0195c@postgresql.org>
Permalink:  ../19074-ae2548458cf0195c@postgresql.org/
Also on:    postgresql.org/message-id/19074-ae2548458cf0195c@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, andrewbille@gmail.com
  Subject: Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases
  In-Reply-To: <19074-ae2548458cf0195c@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox