Re: pg_dump exclusion switches and functions/types - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: pg_dump exclusion switches and functions/types
Date
Msg-id 1160151524.19368.45.camel@coppola.muc.ecircle.de
Whole thread Raw
In response to Re: pg_dump exclusion switches and functions/types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_dump exclusion switches and functions/types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
[Snip explanations]
> Comments?

Would it be reasonable to include one more switch: 'include
dependencies' ?

That would work like this:

* first consider all to be included objects (possibly limited by the
include switches);
* if dependencies are included, add all dependent objects, plus
non-schema objects (which arguably can be considered as dependencies for
the whole data base);
* remove all objects targeted by exclude switches;

This way you won't have any dependency on the ordering, and you could
consider all non-schema objects as dependencies, so they will only be
included if dependencies are to be included. 

Excluding dependencies would be the default if any switches are
specified, including otherwise (not sure how much is this of the
principle of least surprise, but it would be backwards compatible).

The scenario I most care about is to be able to make a complete data
base dump (including non-schema objects) while excluding only a few
tables. If I understood your explanations correctly, this would not be
easily possible with the current implementation. Note that I have a
patch (kludge ?) on the 8.1 pg_dump which does exactly this, it would be
a pity if I would need to patch the 8.2 one again to do that...

Cheers,
Csaba.




pgsql-hackers by date:

Previous
From: "Rocco Altier"
Date:
Subject: Re: Win XP SP2 SMP locking (8.1.4)
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_dump exclusion switches and functions/types