Re: Specify tables to be backed up - Mailing list pgsql-novice

From Tom Lane
Subject Re: Specify tables to be backed up
Date
Msg-id 25528.1221488041@sss.pgh.pa.us
Whole thread Raw
In response to Specify tables to be backed up  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
List pgsql-novice
"Rob Richardson" <Rob.Richardson@rad-con.com> writes:
> I'm thinking the only way of doing what I
> want to do is to have a batch file that contains a string of pg_dump
> calls, something along the lines of:

> pg_dump -t table1 MyDatabase > mydump.backup
> pg_dump -t table2 MyDatabase >> mydump.backup
> pg_dump -t -s big_table_I_only_want_the_schema_of MyDatabase >>
> mydump.backup

> Will that work?  Is there a better way?

Recent versions of pg_dump have switches to exclude specific tables.
Consider
    pg_dump --exclude-table=big_table ...
    pg_dump -s -t big_table ...

            regards, tom lane

pgsql-novice by date:

Previous
From: "Rob Richardson"
Date:
Subject: Specify tables to be backed up
Next
From: "Wright, George"
Date:
Subject: cpu utilization question