Re: Bug in 8.2 (&8.1) dump & restore - Mailing list pgsql-general

From Tom Lane
Subject Re: Bug in 8.2 (&8.1) dump & restore
Date
Msg-id 26459.1167942751@sss.pgh.pa.us
Whole thread Raw
In response to Bug in 8.2 (&8.1) dump & restore  (Scott Ribe <scott_ribe@killerbytes.com>)
List pgsql-general
Scott Ribe <scott_ribe@killerbytes.com> writes:
> create database test;
> \c test
> create table base (foo int not null);
> create table derived () inherits (base);
> alter table derived alter foo drop not null;
> insert into derived values(null);

> Dump it, and the dump will not include any command to drop the not null
> constraint on derived.foo, so restore will fail.

Actually, the bug there is that ALTER TABLE lets you set up a
self-inconsistent inheritance hierarchy.  The above should be illegal
because it would mean that "select foo from base" could return nulls,
contradicting the clear definition of the table.

We've been talking about fixing that, but it'll probably take catalog
changes (to be able to track which constraints were inherited from a
parent table) so this isn't ever going to be enforced by any existing
release.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Any form of connection-level "session variable" ?
Next
From: John McCawley
Date:
Subject: Re: Any form of connection-level "session variable" ?