pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Dumping select tables (omitting tables)
2+ messages / 2 participants
[nested] [flat]

* Dumping select tables (omitting tables)
@ 2003-09-03 18:11  Yuji Shinozaki <ys2n@virginia.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: Yuji Shinozaki @ 2003-09-03 18:11 UTC (permalink / raw)
  To: pgsql-admin


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?

yuji
----
Yuji Shinozaki	                        Computer Systems Senior Engineer
ys2n@virginia.edu			Advanced Technologies Group
(434)924-7171				Information Technology & Communication
http://www.people.virginia.edu/~ys2n    University of Virginia




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Dumping select tables (omitting tables)
@ 2003-09-03 23:14  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Yuji Shinozaki <ys2n@virginia.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 2003-09-03 23:14 UTC (permalink / raw)
  To: Yuji Shinozaki <ys2n@virginia.edu>; +Cc: pgsql-admin

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-09-03 23:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-03 18:11 Dumping select tables (omitting tables) Yuji Shinozaki <ys2n@virginia.edu>
2003-09-03 23:14 ` Bruce Momjian <pgman@candle.pha.pa.us>

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