Bulk INSERT with individual failure

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Bulk INSERT with individual failure
Date: 2013-01-14 01:58:08
Message-ID: CAGYyBgj79HfTp5HnA2zDusN8AEWocMNMbuOjW3BP8n0=QpdwmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need to INSERT a large number of records. For performance reasons,
I'd rather send them to Postgres in one giant INSERT.

However, if there's a problem in one record (eg one row doesn't meet a
constraint), I'd still like the others saved. That is, I specifically
DO NOT want atomic behavior. It's okay to silently drop bad data in
this case - I don't even need to know about it.

Is there any way to do this, or am I forced to but each record into
its own INSERT?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert James 2013-01-14 02:00:39 INSERT... WHERE
Previous Message Adrian Klaver 2013-01-14 01:27:30 Re: Linux Distribution Preferences?