Search Postgresql Archives

Re: Bug in 8.2 (&8.1) dump & restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott Ribe <scott_ribe@xxxxxxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux