pg_restore should accept multiple -t switches?

Started by Fujii Masaoover 15 years ago6 messages
#1Fujii Masao
masao.fujii@gmail.com

Hi,

pg_dump allows us to select multiple target tables by using
multiple -t switches, but pg_restore does not. So, when
restoring multiple tables, we have to run pg_restore more
than once as follows. This is a pain to me.

$ pg_restore -t tbl1 db.dump
$ pg_restore -t tbl2 db.dump

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

$ pg_restore -t tbl1 -t tbl2 db.dump

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

#2David Fetter
david@fetter.org
In reply to: Fujii Masao (#1)
Re: pg_restore should accept multiple -t switches?

On Tue, Aug 10, 2010 at 05:13:22PM +0900, Fujii Masao wrote:

Hi,

pg_dump allows us to select multiple target tables by using
multiple -t switches, but pg_restore does not. So, when
restoring multiple tables, we have to run pg_restore more
than once as follows. This is a pain to me.

$ pg_restore -t tbl1 db.dump
$ pg_restore -t tbl2 db.dump

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

$ pg_restore -t tbl1 -t tbl2 db.dump

Regards,

Yes. :)

What other functionality in pg_dump does pg_restore not duplicate?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#3Erik Rijkers
er@xs4all.nl
In reply to: David Fetter (#2)
Re: pg_restore should accept multiple -t switches?

On Tue, August 10, 2010 13:18, David Fetter wrote:

On Tue, Aug 10, 2010 at 05:13:22PM +0900, Fujii Masao wrote:

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

$ pg_restore -t tbl1 -t tbl2 db.dump

Regards,

Yes. :)

What other functionality in pg_dump does pg_restore not duplicate?

See also "pg_restore -t table : can silently omit constraints":
http://archives.postgresql.org/pgsql-bugs/2009-04/msg00269.php

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Fujii Masao (#1)
Re: pg_restore should accept multiple -t switches?

Fujii Masao <masao.fujii@gmail.com> writes:

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

It's on the TODO list already, no?

regards, tom lane

#5Dimitri Fontaine
dfontaine@hi-media.com
In reply to: Fujii Masao (#1)
Re: pg_restore should accept multiple -t switches?

Fujii Masao <masao.fujii@gmail.com> writes:

pg_dump allows us to select multiple target tables by using
multiple -t switches, but pg_restore does not. So, when
restoring multiple tables, we have to run pg_restore more
than once as follows. This is a pain to me.

Use the list facilities, options -l and -L.

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

I don't think so.

Regards,
--
dim

#6Fujii Masao
masao.fujii@gmail.com
In reply to: Tom Lane (#4)
Re: pg_restore should accept multiple -t switches?

On Tue, Aug 10, 2010 at 11:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Fujii Masao <masao.fujii@gmail.com> writes:

Is it worth allowing pg_restore to accept multiple -t
switches as well as pg_dump?

It's on the TODO list already, no?

Thanks! I found it on the list and understood there are other many
restrictions in pg_restore's -t switch.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center