Re: BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Grzegorz Junka" <xgjx(at)poczta(dot)onet(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.
Date: 2009-04-06 19:14:06
Message-ID: 10611.1239045246@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Grzegorz Junka" <xgjx(at)poczta(dot)onet(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2009-04-07 01:55:36 Re: data loss with pg_standby when doing a controlled failover
Previous Message Grzegorz Junka 2009-04-06 17:34:42 BUG #4751: Incorrect pg_dump output when dropping not null in inherited table.