Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XR1Ak-0000a7-QP for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Sep 2014 15:48:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XR1Ak-0002Nm-9H for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Sep 2014 15:48:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XR1Ai-0002L4-LY for pgsql-bugs@postgresql.org; Mon, 08 Sep 2014 15:48:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XR1Ae-0002Kp-Kg for pgsql-bugs@postgresql.org; Mon, 08 Sep 2014 15:48:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s88FlxvE002681; Mon, 8 Sep 2014 11:47:59 -0400 From: Tom Lane To: m.winkel@w2solutions.nl cc: pgsql-bugs@postgresql.org Subject: Re: BUG #11381: Inherited NOT NULL to NULLABLE column: backup restore error. In-reply-to: <20140908144913.2936.63756@wrigleys.postgresql.org> References: <20140908144913.2936.63756@wrigleys.postgresql.org> Comments: In-reply-to m.winkel@w2solutions.nl message dated "Mon, 08 Sep 2014 14:49:13 -0000" Date: Mon, 08 Sep 2014 11:47:59 -0400 Message-ID: <2680.1410191279@sss.pgh.pa.us> X-Pg-Spam-Score: -4.4 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org m.winkel@w2solutions.nl writes: > CREATE TABLE base > ( > id serial NOT NULL, > name character varying(127) NOT NULL, > nickname character varying(127) NOT NULL, > email_address character varying(512) NOT NULL, > useless_but_required_field text NOT NULL, > CONSTRAINT base_pkey PRIMARY KEY (id) > ) > WITH ( > OIDS=FALSE > ); > CREATE TABLE inherited > ( > CONSTRAINT inherited_pkey PRIMARY KEY (id) > ) > INHERITS (base) > WITH ( > OIDS=FALSE > ); > ALTER TABLE inherited > ALTER COLUMN useless_but_required_field DROP NOT NULL; IMO this should definitely be disallowed. But we lack the catalog infrastructure to do so conveniently. There has been some work towards representing NOT NULL constraints more like CHECK constraints, which do have the required infrastructure. Once that's finished, you'll probably see this be rejected. There's not much point in trying to make pg_dump cope with it, I think. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs