Re: Question about COPY to/from - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Question about COPY to/from
Date
Msg-id 1140545819.5777.11.camel@state.g2switchworks.com
Whole thread Raw
In response to Question about COPY to/from  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-general
On Mon, 2006-02-20 at 16:39, Emi Lu wrote:
> Hello,
>
> We have millions of record and would like to insert into a table. I
> remebered people mentioned that "COPY" is the most effecient way to
> insert data, right? If not, which is it, pg_restore?

Take a look inside a pg_dump output and guess what you'll find... Lots
and lots of copy commands.



>
> By the way, does it have to be superuser to run copy to and from?

Take a look in a pg_dump file again.  You'll see constructs something
like this:

COPY config (conf_name, conf_value) FROM stdin;
o_cur_version   1.2.5
o_board_title   My PunBB forum
o_board_desc    Unfortunately no one can be told what PunBB is - you
have to see it for yourself.
o_server_timezone       0
o_time_format   H:i:s
\.

So, no.  You don't have to be a super user to use COPY, as long as
you're reading from STDIN and not a file.

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: How to specify infinity for intervals ?
Next
From: "Thies C. Arntzen"
Date:
Subject: TSearch2 from HEAD UTF8 German Compunds.