insert fail gracefully if primary key already exists

Поиск
Список
Период
Сортировка
От Alessandro Gagliardi
Тема insert fail gracefully if primary key already exists
Дата
Msg-id CAAB3BB+5LXG=8h6kJje4YGMKDXxzQcPrNowMKXCont+qebaxdw@mail.gmail.com
обсуждение исходный текст
Ответы Re: insert fail gracefully if primary key already exists  (Bartosz Dmytrak <bdmytrak@eranet.pl>)
Список pgsql-novice
I have a situation where I am gradually filling in a table from another database as the need requires. As it currently is, whenever a record comes up, it tries to insert it into my database. If the row is already there, the primary key collides and the insert fails. And that's fine except that it makes for a really cluttered log (making it hard to find errors that I really do need to pay attention to). I'm wondering if there's a better (i.e. cleaner, but possibly also more efficient) way to do this. 

Thoughts?

Thank you in advance,
-Alessandro

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Functions and query analysis - EXPLAIN
Следующее
От: "lmanorders"
Дата:
Сообщение: Using libpq 8.4 with PostgreSQL 9.1