Re: BUG #4751: Incorrect pg_dump output when dropping not null in inherited table. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.
Date
Msg-id 10611.1239045246@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.  ("Grzegorz Junka" <xgjx@poczta.onet.pl>)
List pgsql-bugs
"Grzegorz Junka" <xgjx@poczta.onet.pl> writes:
> I don't know if these steps below are allowed, but documentation doesn't say
> anything that they are not.

> create table parent_table (someint integer not null);
> create table child_table (id integer) inherits (parent_table);
> alter table only child_table alter column someint drop not null;

This is not considered valid: the result would be that "select * from
parent_table" could show some null values of someint, which would be
unexpected given its constraint.  We are not currently enforcing that
but it will probably start being enforced in 8.5 or so.  (As of 8.4,
a similar rule for inherited check constraints *is* enforced.)

It's not really a pg_dump bug that it fails to cope with the case;
rather it's a backend bug that you can get into this state at all.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Grzegorz Junka"
Date:
Subject: BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.
Next
From: Fujii Masao
Date:
Subject: Re: data loss with pg_standby when doing a controlled failover