Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YdfVO-0005Yd-KH for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2015 13:49:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YdfVN-0005sT-V7 for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2015 13:49:58 +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 1YdfVM-0005sM-MM for pgsql-bugs@postgresql.org; Thu, 02 Apr 2015 13:49:56 +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 1YdfVI-0000vN-B0 for pgsql-bugs@postgresql.org; Thu, 02 Apr 2015 13:49:54 +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 t32DnoPM008170; Thu, 2 Apr 2015 09:49:50 -0400 From: Tom Lane To: degtyaryov@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #12946: pg_dump/pg_restore not restore data for inherit tables In-reply-to: <20150402123644.2573.95526@wrigleys.postgresql.org> References: <20150402123644.2573.95526@wrigleys.postgresql.org> Comments: In-reply-to degtyaryov@gmail.com message dated "Thu, 02 Apr 2015 12:36:44 -0000" Date: Thu, 02 Apr 2015 09:49:50 -0400 Message-ID: <8169.1427982590@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 degtyaryov@gmail.com writes: > $ psql -U test -d test_inherits > test_inherits=> create table t1(a integer not null, b integer); > CREATE TABLE > test_inherits=> create table t2(a integer, b integer) inherits (t1); > CREATE TABLE > test_inherits=> insert into t1(a,b) values(null,1); > ERROR: null value in column "a" violates not-null constraint > DETAIL: Failing row contains (null, 1). > test_inherits=> insert into t2(a,b) values(null,1); > INSERT 0 1 > test_inherits=> \q [ scratches head... ] When I do that, it refuses to insert into t2 either: regression=# create table t1(a integer not null, b integer); CREATE TABLE regression=# create table t2(a integer, b integer) inherits (t1); NOTICE: merging column "a" with inherited definition NOTICE: merging column "b" with inherited definition CREATE TABLE regression=# insert into t1(a,b) values(null,1); ERROR: null value in column "a" violates not-null constraint DETAIL: Failing row contains (null, 1). regression=# insert into t2(a,b) values(null,1); ERROR: null value in column "a" violates not-null constraint DETAIL: Failing row contains (null, 1). This is the behavior I would expect, and I see it in all active branches. Have you modified the code around column inheritance? 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