From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Yuji Shinozaki <ys2n@virginia.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: Dumping select tables (omitting tables)
Date: Wed, 3 Sep 2003 19:14:35 -0400 (EDT)
Message-ID: <200309032314.h83NEZH12671@candle.pha.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.44.0309031356230.1994-100000@atg2000.itc.virginia.edu>
Yuji Shinozaki wrote:
>
> I would like to dump select tables from a database (omitting some tables).
>
> It looks like pg_dump only allows you to dump the entire database or
> select single tables to dump. Is there a way to specify to pg_dump a
> list of tables to dump (or to omit)?
>
> I can dump all the desired tables as single dumps, but
> dump-many-single-tables approach is troublesome since I want to apply the
> indexes at the end to make the restore more efficient (and to avoid
> integrity checking until the entire database is restored)
>
> Wouldn't that mean hand-editing the dumps to apply the indexes separately
> (or at least last)? Or can I simply concatenate all these single-table
> dumps and tell pg_restore to apply the indexes last?
>
> Is there a simple way to accomplish this?
>
You can just concatenate them, I think. The only thing I don't know is
how referential integrity constraints will be handled because the
primary table might not exist when you create the foreign table.
We can dump specific schemas in 7.4beta. You can do a full dump and use
pg_resetore to pull out specific tables, but then again, I don't know
how it handles referential integrity.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: pgman@candle.pha.pa.us, ys2n@virginia.edu
Subject: Re: Dumping select tables (omitting tables)
In-Reply-To: <200309032314.h83NEZH12671@candle.pha.pa.us>
References: <Pine.LNX.4.44.0309031356230.1994-100000@atg2000.itc.virginia.edu> <200309032314.h83NEZH12671@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox