Re: insert fail gracefully if primary key already exists

From: Bartosz Dmytrak <bdmytrak(at)eranet(dot)pl>
To: Alessandro Gagliardi <alessandro(at)path(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: insert fail gracefully if primary key already exists
Date: 2012-02-11 08:08:04
Message-ID: CAD8_UcZFC2bez4W3ujs-DZh5MdgLO79TA=1-Q_JB=ucN71z0kg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Could You provide more details?
PostgreSQL does not allow cross database queries.

Regards,
Bartek

2012/2/10 Alessandro Gagliardi <alessandro(at)path(dot)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
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message JORGE MALDONADO 2012-02-12 00:13:51 HTML encode/decode
Previous Message lmanorders 2012-02-10 22:29:29 Using libpq 8.4 with PostgreSQL 9.1