Search Postgresql Archives

Re: Question about COPY to/from

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux