Re: duplicate key value violates unique constraint "tableName_pk"

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: duplicate key value violates unique constraint "tableName_pk"
Дата
Msg-id 509B16CC.5050905@ringerc.id.au
обсуждение исходный текст
Ответ на duplicate key value violates unique constraint "tableName_pk"  (Saravanan Nagarajan <n.saravanan86@gmail.com>)
Список pgsql-bugs
On 11/07/2012 07:21 PM, Saravanan Nagarajan wrote:
> Hi ,
>
> I am using "Copy From" while dumping bulk data into PGSQL DB from
> file. While I am trying to insert the rows, if the primary key already
> exists, the complete transaction terminated.
>
> Postgres cannot handle the constraint violations , i found it
> into http://wiki.postgresql.org/wiki/COPY#Caveats_with_implementation .
>
> Is there any possible way to insert bulk data using "Copy From" with
> REPLACE/IGNORE duplicates.
Typically you COPY into a temporary or UNLOGGED table, then merge the
data into the target table using appropriate `UPDATE ... FROM ... WHERE`
and `INSERT ... SELECT ... WHERE` statements.

--
Craig Ringer

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tianyin Xu
Дата:
Сообщение: Re: [BUGS] BUG #7642: Unchecked “stats_temp_directory” causes server hang to requests
Следующее
От: Denis Feklushkin
Дата:
Сообщение: Re: PQsendQueryParams() causes prepared statement error