should all not-null constraints be inherited?

From: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
To: pgsql-bugs(at)postgresql(dot)org
Subject: should all not-null constraints be inherited?
Date: 2021-03-31 15:12:40
Message-ID: a9514aea-af19-8b29-1713-17874fffdea0@imap.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-03-31 16:22:57 BUG #16950: Query Planer make wrong plan with CTE and foreign table
Previous Message Joel Jacobson 2021-03-31 06:40:32 [BUG] pg_identify_object_as_address() returns duplicate values