Unix Technical Forum

Re: pg_dump, pg_restore, insert vs copy

This is a discussion on Re: pg_dump, pg_restore, insert vs copy within the pgsql Admins forums, part of the PostgreSQL category; --> OK, here is what I see: from top: 17718 postgres 25 0 293M 293M 292M R 22.2 7.6 28:26 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 01:35 AM
Lee Wu
 
Posts: n/a
Default Re: pg_dump, pg_restore, insert vs copy

OK, here is what I see:

from top:

17718 postgres 25 0 293M 293M 292M R 22.2 7.6 28:26 2
postgres: postgres mydb 127.0.0.1:41972 INSERT

MY OS command is:
pg_restore -v -t mytable -d mydb -U postgres -R my.dmp

SQL from database:

mydb=# select datname, procpid, current_query
mydb-# from pg_stat_activity
mydb-# where current_query != '<IDLE>';
datname | procpid |
current_query

---------+---------+----------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
-------------------------------------------------------------
mydb | 17718 | INSERT INTO mytable VALUES (...
(1 row)

Thanks,

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, March 24, 2005 8:52 AM
To: Lee Wu
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] pg_dump, pg_restore, insert vs copy

"Lee Wu" <Lwu@mxlogic.com> writes:
> When I use pg_dump to back up the whole database and then pg_restore

an
> individual table,
> pg_restore uses COPY. Great.
> When I use pg_dump to back up an individual table and pg_restore it,
> pg_restore uses INSERT.


Not for me...

That decision is fixed at pg_dump time; it's not possible for pg_restore
to change it, because the data is already that way (or not) in the dump
file. Maybe you misinterpreted what you saw?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 01:35 AM
Tom Lane
 
Posts: n/a
Default Re: pg_dump, pg_restore, insert vs copy

"Lee Wu" <Lwu@mxlogic.com> writes:
> MY OS command is:
> pg_restore -v -t mytable -d mydb -U postgres -R my.dmp


That doesn't prove a thing; the question is what you typed at pg_dump.

Thinking about it, I wonder if you did "pg_dump -d mydb ..."
-d means something different to pg_dump than pg_restore.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:48 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com