| От | Chris Withers |
|---|---|
| Тема | Re: dumping table contents in a sensible order |
| Дата | |
| Msg-id | e2a1a95b-9a29-e491-b9b2-47e66983746d@simplistix.co.uk обсуждение исходный текст |
| Ответ на | Re: dumping table contents in a sensible order (Adrian Klaver <adrian.klaver@aklaver.com>) |
| Список | pgsql-general |
On 16/11/2016 01:05, Adrian Klaver wrote: >> INSERT 0 1 >> ERROR: insert or update on table "table_one" violates foreign key >> constraint "table_one_parent_id_fkey" >> DETAIL: Key (parent_id)=(xxx) is not present in table "table_one". >> >> So, the problem appears to be that table_one is self-referential by way >> of a parent_id field. >> >> How can I either: >> >> - dump the table in an insertable order? > > Don't use --inserts, instead let the data be entered via COPY(the > default) which does it a single transaction. That fixed it, many thanks. I guess that'll teach me to use an answer from StackOverflow without full understanding the details... Chris
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера