Re: error-tolerant COPY FROM

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: "Joolz" <joolz(at)arbodienst-limburg(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: error-tolerant COPY FROM
Date: 2005-02-04 13:41:56
Message-ID: 896D4495-76B2-11D9-8DF0-000D933565E8@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Feb 4, 2005, at 8:30 AM, Joolz wrote:

> Sean Davis zei:
>> I use a trigger on tables with foreign key references to either
>> ignore
>> the insert row or insert an appropriate matching row in the
>> referenced
> Thanks Sean, but in my situation I don't want the database to be so
> versatile as to handle all the errors itself, this would create
> unneccesary load during all operations on the tables, not only when
> running the import.
>

Just drop the trigger once the table is copied. In my application (a
hundred thousand to million rows or so per table), using copy rather
than DBI inserts is an order of magnitude or two faster, even with the
triggers in place.

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-02-04 13:44:42 Re: error-tolerant COPY FROM
Previous Message Ben-Nes Yonatan 2005-02-04 13:34:48 Re: mysql load_file() function