Re: dumping table contents in a sensible order - Mailing list pgsql-general

From Chris Withers
Subject Re: dumping table contents in a sensible order
Date
Msg-id e2a1a95b-9a29-e491-b9b2-47e66983746d@simplistix.co.uk
Whole thread Raw
In response to Re: dumping table contents in a sensible order  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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 by date:

Previous
From: Yogesh Sharma
Date:
Subject: Re: Request to share information regarding errors
Next
From: "Charles Clavadetscher"
Date:
Subject: Re: Request to share information regarding errors