Search Postgresql Archives

Re: dumping table contents in a sensible order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux