Re: INSERT or COPY: Which one? - Mailing list pgsql-novice

From Bryan Irvine
Subject Re: INSERT or COPY: Which one?
Date
Msg-id 1086294229.12812.15.camel@elvis2.horvitznewspapers.net
Whole thread Raw
In response to Re: INSERT or COPY: Which one?  (Nabil Sayegh <postgresql@e-trolley.de>)
List pgsql-novice
I got this today and I don't know the if the list is behind or the
senders client, so I'll reply anyway.

I did some benchmark testing of copy vs insert, using a 3 million record
file with 1 table and 3 fields containing 10 numbers (between all
fields, they were phonenumbers to be precise).  The insert took about 2
hours (this was last summer so my numbers might be slightly off) and the
copy took 45 seconds.

So use copy when appropriate.

--Bryan

On Tue, 2004-02-17 at 12:01, Nabil Sayegh wrote:
> Colin Gillespie wrote:
> > Dear All,
> >
> > I which to insert text (more than 1000 lines) into a single cell of my table, should I use COPY here or INSERT?
> >
> > My reading seems to suggest that you would use COPY for mulitple INSERTs, but when inserting alot of data into one
cell,INSERT is fine. Is this correct? 
>
> COPY is much faster, INSERT is safer.
> I heard that all issues regarding COPY are fixed (since 7.3?), but IIRC I still had some trouble
> with SERIALs and referential integrity.
>
> HTH


pgsql-novice by date:

Previous
From: Frank Bax
Date:
Subject: Re: Executing sql script
Next
From: Frank Bax
Date:
Subject: Re: Executing sql script