Re: pg_dump, pg_restore, insert vs copy

From: "Lee Wu" <Lwu(at)mxlogic(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump, pg_restore, insert vs copy
Date: 2005-03-24 16:05:39
Message-ID: ECAB83AA52BCC043A0E24BBC00001024D2E6BD@mxhq-exch.corp.mxlogic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thursday, March 24, 2005 8:52 AM
To: Lee Wu
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] pg_dump, pg_restore, insert vs copy

"Lee Wu" <Lwu(at)mxlogic(dot)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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-03-24 16:10:43 Re: pg_dump, pg_restore, insert vs copy
Previous Message Tom Lane 2005-03-24 15:52:06 Re: pg_dump, pg_restore, insert vs copy