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