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