X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 91C54D1B8B3 for ; Wed, 3 Sep 2003 23:14:46 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 59356-01 for ; Wed, 3 Sep 2003 20:14:38 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 049DFD1B53A for ; Wed, 3 Sep 2003 20:14:35 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h83NEZH12671; Wed, 3 Sep 2003 19:14:35 -0400 (EDT) From: Bruce Momjian Message-Id: <200309032314.h83NEZH12671@candle.pha.pa.us> Subject: Re: Dumping select tables (omitting tables) In-Reply-To: To: Yuji Shinozaki Date: Wed, 3 Sep 2003 19:14:35 -0400 (EDT) Cc: pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/46 X-Sequence-Number: 10134 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