Re: BUG #6024: pg_dump won't dump ALTERed inherited fields - Mailing list pgsql-bugs

From P. Christeas
Subject Re: BUG #6024: pg_dump won't dump ALTERed inherited fields
Date
Msg-id 201105121932.06658.p_christ@hol.gr
Whole thread Raw
In response to Re: BUG #6024: pg_dump won't dump ALTERed inherited fields  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Thursday 12 May 2011, you wrote:
> "Panos Christeas" <xrg@linux.gr> writes:
> > CREATE TABLE test1(id SERIAL PRIMARY KEY,
> >     name VARCHAR(20) NOT NULL);
> > CREATE TABLE test2(description TEXT) INHERITS(test1);
> > ALTER TABLE test2 ALTER name DROP NOT NULL;
> >
> > pg_dump that.
> > The dump will still have "not null" constraint at test2.name.
>
> This isn't really a pg_dump deficiency.  The bug is that we let you do
> that ALTER.  Inherited constraints shouldn't be droppable, and indeed
> are not droppable except in the single case of NOT NULL.  This is on the
> to-fix list --- in fact there was a patch submitted for it last year,
> although it got returned for rework and we've not seen it again yet.
>

That's fine for me. Just as long as pg_dump is consistent* with what the schema
can be.

Perhaps, some errata or warning in the documentation would do, too. (is there
any, already? )

* however, do consider that old servers will still be able to hold such
inconsistent (I admit it) data; we can't apply that behavior to them.


--
Say NO to spam and viruses. Stop using Microsoft Windows!

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6024: pg_dump won't dump ALTERed inherited fields
Next
From: Daniel Grace
Date:
Subject: Re: BUG #6005: ALTER ROLE ... VALID UNTIL 'infinity' crashes postmaster on a fresh install