Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C54E6B5DCE9 for ; Thu, 12 May 2011 13:39:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 70820-03 for ; Thu, 12 May 2011 16:38:58 +0000 (UTC) X-Greylist: delayed 00:06:39.066824 by SQLgrey-1.7.6 Received: from outgoing.holservices.gr (outgoing.holservices.gr [62.38.2.44]) by mail.postgresql.org (Postfix) with SMTP id 7DCBAB5D8BD for ; Thu, 12 May 2011 13:38:57 -0300 (ADT) Received: (qmail 9885 invoked from network); 12 May 2011 16:09:10 -0000 Received: from unknown (HELO deliver.mail.dc.hol.net) (192.168.20.70) by arete.mail.dc.hol.net with SMTP; 12 May 2011 16:09:10 -0000 Received: from auth-smtp.hol.gr (takeit01.mail.dc.hol.net [192.168.20.71]) by deliver.hol.gr (8.12.11/8.11.6) with ESMTP id p4CGVlrB027672 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256 bits) verified OK); Thu, 12 May 2011 19:31:47 +0300 Received: from pfn1.pefnos (ppp046177086244.dsl.hol.gr [46.177.86.244]) by auth-smtp.hol.gr (8.13.1/8.13.1) with ESMTP id p4CGVk1t019213; Thu, 12 May 2011 19:31:46 +0300 Received: from xorhgos3.localnet (ppp-94-66-238-170.home.otenet.gr [94.66.238.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pfn1.pefnos (Postfix) with ESMTPSA id 85FB7101B9; Thu, 12 May 2011 19:32:07 +0300 (EEST) From: "P. Christeas" To: Tom Lane Subject: Re: BUG #6024: pg_dump won't dump ALTERed inherited fields Date: Thu, 12 May 2011 19:32:04 +0300 User-Agent: KMail/1.13.6 (Linux/2.6.38.5+; KDE/4.6.1; x86_64; ; ) References: <201105120914.p4C9ELvP076791@wwwmaster.postgresql.org> <16597.1305213853@sss.pgh.pa.us> In-Reply-To: <16597.1305213853@sss.pgh.pa.us> Cc: pgsql-bugs@postgresql.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-7" Content-Transfer-Encoding: 7bit Message-Id: <201105121932.06658.p_christ@hol.gr> X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on takeit01.mail.dc.hol.net X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201105/110 X-Sequence-Number: 30249 On Thursday 12 May 2011, you wrote: > "Panos Christeas" 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!