Insert (ignore) with unique constraint on

Поиск
Список
Период
Сортировка
От Victor Ciurus
Тема Insert (ignore) with unique constraint on
Дата
Msg-id e7a72f4004112505347278a976@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi all,

What I'am trying to do using Postgresql is to make and "INSERT into
table A (2 fields) (select * from Table B) - (2 fields + unique btree
Index)" or a "COPY table_B from FILE using...". The problem is that
everytime I get duplicates from table A into table B the insert will
stop with the typical error: 'ERROR:  duplicate key violates unique
constraint "string_idx"'

Q: Is there a way (like in MySQL's INSERT IGNORE) of going on with the
INSERT / COPY FROM ... even if a dupplicate / unique constraint
violation shows on! Somekind of a 'exception/error treating' routine
in SQL or PG-PL?

Any help will be highly appreciated.

Regards,
Victor

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

Предыдущее
От: "Katsaros Kwn/nos"
Дата:
Сообщение: SPI memory overrun details
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Benchmark-Comparison PostGreSQL vs. SQL Server