Обсуждение: pg_dump more than one table in one command?

Поиск
Список
Период
Сортировка

pg_dump more than one table in one command?

От
Emi Lu
Дата:
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?

От
"Harold A. Giménez Ch."
Дата:
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?

От
"Scott Marlowe"
Дата:
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?

От
"Harold A. Giménez Ch."
Дата:
Looks like you are right, Scott. Thanks! I wasn't in Postgres land back then.

On Mon, Oct 6, 2008 at 5:48 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
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