should all not-null constraints be inherited? - Mailing list pgsql-bugs

From Alexey Bashtanov
Subject should all not-null constraints be inherited?
Date
Msg-id a9514aea-af19-8b29-1713-17874fffdea0@imap.cc
Whole thread Raw
Responses Re: should all not-null constraints be inherited?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hello,

This is how one can create a parent with a non-nullable column and a 
child with the same column nullable:

create table t1(a int not null);
create table t2() inherits (t1);
alter table t2 alter column a drop not null;
insert into t2 select null;

pg_dump produces a dump that fails to restore, as the change by the 
alter command doesn't get addressed.
Reproduced in 10 and 14devel.

Should we fix ALTER TABLE or pg_dump?

Best, Alex



pgsql-bugs by date:

Previous
From: "Joel Jacobson"
Date:
Subject: [BUG] pg_identify_object_as_address() returns duplicate values
Next
From: PG Bug reporting form
Date:
Subject: BUG #16950: Query Planer make wrong plan with CTE and foreign table