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

From Bartosz Dmytrak
Subject Re: insert fail gracefully if primary key already exists
Date
Msg-id CAD8_UcZFC2bez4W3ujs-DZh5MdgLO79TA=1-Q_JB=ucN71z0kg@mail.gmail.com
Whole thread Raw
In response to insert fail gracefully if primary key already exists  (Alessandro Gagliardi <alessandro@path.com>)
Responses Re: insert fail gracefully if primary key already exists
List pgsql-novice
Could You provide more details?
PostgreSQL does not allow cross database queries.


Regards,
Bartek

2012/2/10 Alessandro Gagliardi <alessandro@path.com>
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: "lmanorders"
Date:
Subject: Using libpq 8.4 with PostgreSQL 9.1
Next
From: JORGE MALDONADO
Date:
Subject: HTML encode/decode