Re: dumping table contents in a sensible order

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Yogesh Sharma
Дата:
Сообщение: Re: Request to share information regarding errors
Следующее
От: "Charles Clavadetscher"
Дата:
Сообщение: Re: Request to share information regarding errors