insert fail gracefully if primary key already exists - Mailing list pgsql-novice

From Alessandro Gagliardi
Subject insert fail gracefully if primary key already exists
Date
Msg-id CAAB3BB+5LXG=8h6kJje4YGMKDXxzQcPrNowMKXCont+qebaxdw@mail.gmail.com
Whole thread Raw
Responses Re: insert fail gracefully if primary key already exists  (Bartosz Dmytrak <bdmytrak@eranet.pl>)
List 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 by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: Functions and query analysis - EXPLAIN
Next
From: "lmanorders"
Date:
Subject: Using libpq 8.4 with PostgreSQL 9.1