Re: PostgreSQL Write Performance - Mailing list pgsql-general

From Craig Ringer
Subject Re: PostgreSQL Write Performance
Date
Msg-id 4B43CC43.60505@postnewspapers.com.au
Whole thread Raw
In response to Re: PostgreSQL Write Performance  (Tim Uckun <timuckun@gmail.com>)
Responses Re: PostgreSQL Write Performance  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general
On 6/01/2010 6:21 AM, Tim Uckun wrote:
>> You might use the copy command instead of insert, which is far faster.
>> If you want the fastest possible inserts, then probably copy is the way
>> to go instead of insert.
>> Here is copy command via API:
>> http://www.postgresql.org/docs/current/static/libpq-copy.html
>> Here is copy command via SQL:
>> http://www.postgresql.org/docs/8.4/static/sql-copy.html
>>
>
> Is there a command like COPY which will insert the data but skip all
> triggers and optionally integrity checks.

No. If you don't want triggers and integrity checks to fire, don't
define them in the first place.

Technically you *can* disable triggers, including RI checks, but it's
VERY unwise and almost completely defeats the purpose of having the
checks. In most such situations you're much better off dropping the
constraints then adding them again at the end of the load.

--
Craig Ringer

pgsql-general by date:

Previous
From: Jeff Ross
Date:
Subject: pgbench out of memory error
Next
From: Roman Neuhauser
Date:
Subject: Re: set-level update fails with unique constraint violation