Re: [BUGS] pg_dump and pg_restore on inherited tables problem - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] pg_dump and pg_restore on inherited tables problem
Date
Msg-id 31331.1504538679@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] pg_dump and pg_restore on inherited tables problem  (Piotr S <stegiszn@gmail.com>)
Responses Re: [BUGS] pg_dump and pg_restore on inherited tables problem
List pgsql-bugs
Piotr S <stegiszn@gmail.com> writes:
> Hello, i think there is a problem with some specify situation when source
> database was set different default value between main and inherited table.

The problem here is that your child table doesn't have a not-null
constraint on the inh_level column, while the parent does.  That's
a logically inconsistent situation, and it's not really pg_dump's
fault that it fails to reproduce it exactly.

We've fixed that problem in v10: now, the child table inherits the
not-null constraint when you do the ALTER ADD PRIMARY KEY.  So your setup
script fails to insert the inconsistent data:

d1=# INSERT INTO test_otw(id, description) VALUES (1, 'some test row');
ERROR:  null value in column "inh_level" violates not-null constraint
DETAIL:  Failing row contains (1, null, some test row).
        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

pgsql-bugs by date:

Previous
From: Piotr S
Date:
Subject: [BUGS] pg_dump and pg_restore on inherited tables problem
Next
From: Michael Paquier
Date:
Subject: Re: [BUGS] pg_dump and pg_restore on inherited tables problem