Re: pg_dump, pg_restore, insert vs copy

Поиск
Список
Период
Сортировка
От Lee Wu
Тема Re: pg_dump, pg_restore, insert vs copy
Дата
Msg-id ECAB83AA52BCC043A0E24BBC00001024D2E6BD@mxhq-exch.corp.mxlogic.com
обсуждение исходный текст
Ответ на pg_dump, pg_restore, insert vs copy  ("Lee Wu" <Lwu@mxlogic.com>)
Ответы Re: pg_dump, pg_restore, insert vs copy  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump, pg_restore, insert vs copy
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump, pg_restore, insert vs copy