Re: Dump a database excluding one table DATA? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Dump a database excluding one table DATA?
Date
Msg-id 201108190705.37995.adrian.klaver@gmail.com
Whole thread Raw
In response to Re: Dump a database excluding one table DATA?  (Dmitry Koterov <dmitry@koterov.ru>)
List pgsql-general
On Thursday, August 18, 2011 3:25:59 pm Dmitry Koterov wrote:
> Mmm, --disable-triggers is not surely enough - we also have RULEs and (much
> worse) INDEXes.
>
> If we create all indices and then restore all data, it is MUCH SLOWER than
> restore the data first and then - create all indices.
> So I think that there is no work-around really...

Yes there is. Do the schema only dump of the table in question, comment out the
Indexes and rules you don't want. Load the data. Go back to the schema dump
comment out the table and uncomment the Indexes/rules,etc .
Or
Write a script that does the same thing automatically.


>
> I propose to include an option to pg_dump to skip several tables data
> restoration. :-)
>

I thought you where looking to exclude only one table. As you found out the
dependency issues for one table can be a problem. Doing more than one makes the
process even more brittle.

--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: Getting value of bind variables
Next
From: "Gauthier, Dave"
Date:
Subject: Need linux uid in pg-psql