From: Tom Lane <tgl@sss.pgh.pa.us>
To: Piotr S <stegiszn@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_dump and pg_restore on inherited tables problem
Date: Mon, 04 Sep 2017 11:24:39 -0400
Message-ID: <31331.1504538679@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJK3YFKP8DEFY-TFQiUpCQ-v_AOYirOkUmP_Z4c9GLiOXy8hUw@mail.gmail.com>
References: <CAJK3YFKP8DEFY-TFQiUpCQ-v_AOYirOkUmP_Z4c9GLiOXy8hUw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, stegiszn@gmail.com
Subject: Re: pg_dump and pg_restore on inherited tables problem
In-Reply-To: <31331.1504538679@sss.pgh.pa.us>
References: <CAJK3YFKP8DEFY-TFQiUpCQ-v_AOYirOkUmP_Z4c9GLiOXy8hUw@mail.gmail.com> <31331.1504538679@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox