I try to dump a db to another. There are some duplicate unique values in a tables. When pg_dump try to add this item to db, it throw an error and exit. Error is like;
ERROR: duplicate key value violates unique constraint "test_table_pkey"
DETAIL: Key (pktable)=(col11) already exists.
CONTEXT: COPY test_table, line 1: "col11 col12"
My table is;
Column | Type | Modifiers
-------------+-----------------------+-----------
pktable | text | not null
source | text | not null
Indexes:
"test_table_pkey" PRIMARY KEY, btree (pktable)
My command is;
pg_dump -U postgres -v --data-only <db_name> | psql -U postgres -h <remote_host> -d <db_name>
I want to that pg_dump skip duplicate unique value and continue to dump operation. How can I do that?