Re: [BUGS] pg_dump and pg_restore on inherited tables problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] pg_dump and pg_restore on inherited tables problem
Дата
Msg-id 31331.1504538679@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] pg_dump and pg_restore on inherited tables problem  (Piotr S <stegiszn@gmail.com>)
Ответы Re: [BUGS] pg_dump and pg_restore on inherited tables problem  (Michael Paquier <michael.paquier@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Piotr S
Дата:
Сообщение: [BUGS] pg_dump and pg_restore on inherited tables problem
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [BUGS] pg_dump and pg_restore on inherited tables problem