Thread: pg_dump more than one table in one command?

pg_dump more than one table in one command?

From
Emi Lu
Date:
Good morning,

Under postgreSQL 8.0, could someone tell me how to pg_dump more than one 
tables at the same time please?

I tried to do something like:

pg_dump -h machineName -U username --inserts --column-inserts 
--file=dump.sql --table=t1 t2 ... ...tN -d databaseName ;

Thanks a lot!


Re: pg_dump more than one table in one command?

From
"Harold A. Giménez Ch."
Date:
You must specify --table (or -t) once for each of the tables, ie:

pg_dump -h machineName -U username --inserts --column-inserts --file=dump.sql --table=t1 --table=t2 ..... ..... --table=tN -d databaseName ;

-t t1 -t t2 -t t3

On Mon, Oct 6, 2008 at 5:02 PM, Emi Lu <emilu@encs.concordia.ca> wrote:
Good morning,

Under postgreSQL 8.0, could someone tell me how to pg_dump more than one tables at the same time please?

I tried to do something like:

pg_dump -h machineName -U username --inserts --column-inserts --file=dump.sql --table=t1 t2 ... ...tN -d databaseName ;

Thanks a lot!

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Re: pg_dump more than one table in one command?

From
"Scott Marlowe"
Date:
On Mon, Oct 6, 2008 at 3:24 PM, Harold A. Giménez Ch.
<harold.gimenez@gmail.com> wrote:
>
> On Mon, Oct 6, 2008 at 5:02 PM, Emi Lu <emilu@encs.concordia.ca> wrote:
>>
>> Good morning,
>>
>> Under postgreSQL 8.0, could someone tell me how to pg_dump more than one
>> tables at the same time please?
>>
>> I tried to do something like:
>>
>> pg_dump -h machineName -U username --inserts --column-inserts
>> --file=dump.sql --table=t1 t2 ... ...tN -d databaseName ;
> You must specify --table (or -t) once for each of the tables, ie:
> pg_dump -h machineName -U username --inserts --column-inserts
> --file=dump.sql --table=t1 --table=t2 ..... ..... --table=tN -d databaseName
> ;
>
> -t t1 -t t2 -t t3

I'm pretty sure that the ability to handle multiple -t switches was an
8.2 release feature.  See the release notes (search for -t)

http://www.postgresql.org/docs/8.3/static/release-8-2.html


Re: pg_dump more than one table in one command?

From
"Harold A. Giménez Ch."
Date:
<div dir="ltr">Looks like you are right, Scott. Thanks! I wasn't in Postgres land back then.<br /><br /><div
class="gmail_quote">OnMon, Oct 6, 2008 at 5:48 PM, Scott Marlowe <span dir="ltr"><<a
href="mailto:scott.marlowe@gmail.com">scott.marlowe@gmail.com</a>></span>wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On
Mon,Oct 6, 2008 at 3:24 PM, Harold A. Giménez Ch.<br /> <<a
href="mailto:harold.gimenez@gmail.com">harold.gimenez@gmail.com</a>>wrote:<br /> ><br /> > On Mon, Oct 6, 2008
at5:02 PM, Emi Lu <<a href="mailto:emilu@encs.concordia.ca">emilu@encs.concordia.ca</a>> wrote:<br /> >><br
/>>> Good morning,<br /> >><br /> >> Under postgreSQL 8.0, could someone tell me how to pg_dump more
thanone<br /> >> tables at the same time please?<br /> >><br /> >> I tried to do something like:<br
/>>><br /> >> pg_dump -h machineName -U username --inserts --column-inserts<br /> >> --file=dump.sql
--table=t1t2 ... ...tN -d databaseName ;<br /> > You must specify --table (or -t) once for each of the tables,
ie:<br/> > pg_dump -h machineName -U username --inserts --column-inserts<br /> > --file=dump.sql --table=t1
--table=t2..... ..... --table=tN -d databaseName<br /> > ;<br /> ><br /> > -t t1 -t t2 -t t3<br /><br
/></div>I'mpretty sure that the ability to handle multiple -t switches was an<br /> 8.2 release feature.  See the
releasenotes (search for -t)<br /><br /><a href="http://www.postgresql.org/docs/8.3/static/release-8-2.html"
target="_blank">http://www.postgresql.org/docs/8.3/static/release-8-2.html</a><br/></blockquote></div><br /></div>