Re: Dumping select tables (omitting tables)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Yuji Shinozaki <ys2n(at)virginia(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Dumping select tables (omitting tables)
Date: 2003-09-03 23:14:35
Message-ID: 200309032314.h83NEZH12671@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message AlmawElias Fantahun 2003-09-04 03:13:00 Re: unsubscrib
Previous Message AlmawElias Fantahun 2003-09-03 23:06:33 unsubscrib

Browse pgsql-general by date

  From Date Subject
Next Message Josué Maldonado 2003-09-03 23:38:28 Re: TCL trigger doesn't work after deleting a column
Previous Message Bruce Momjian 2003-09-03 23:05:56 Re: What is the good equivalent for ENUM ?