Lists: | pgsql-hackers |
---|
From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | pg_restore should accept multiple -t switches? |
Date: | 2010-08-10 08:13:22 |
Message-ID: | AANLkTikoJ1qZfyxHVh4xUEp0G92kCfXrevR3+ybtPseX@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore should accept multiple -t switches? |
Date: | 2010-08-10 11:18:55 |
Message-ID: | 20100810111855.GD29153@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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
From: | "Erik Rijkers" <er(at)xs4all(dot)nl> |
---|---|
To: | "David Fetter" <david(at)fetter(dot)org> |
Cc: | "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore should accept multiple -t switches? |
Date: | 2010-08-10 12:01:31 |
Message-ID: | 1f74c7cb3b4bdcd668d03ab789f1b242.squirrel@webmail.xs4all.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore should accept multiple -t switches? |
Date: | 2010-08-10 14:00:46 |
Message-ID: | 28986.1281448846@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Fujii Masao <masao(dot)fujii(at)gmail(dot)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
From: | Dimitri Fontaine <dfontaine(at)hi-media(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore should accept multiple -t switches? |
Date: | 2010-08-10 19:45:16 |
Message-ID: | m2d3tqz1yr.fsf@hi-media.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Fujii Masao <masao(dot)fujii(at)gmail(dot)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
From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore should accept multiple -t switches? |
Date: | 2010-08-11 04:35:20 |
Message-ID: | AANLkTingQyZ9ED_zo9DN+CqHWs515gq7WVF0Rwpzwc8q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Tue, Aug 10, 2010 at 11:00 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Fujii Masao <masao(dot)fujii(at)gmail(dot)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