Hi Stephen!

Stephen Frost [2006-02-08 14:07 -0500]:
> > > This looks good, the only thing I think we need to double-check is how
> > > data is handled (ie: is the data portion a seperate 'object' which needs
> > > to be filtered somehow, or is it associated with the base 'object', ie:
> > > table, that the data is from?).  Assuming the above handles the data as
> > > well as the actual object itself then it should work well.
> > 
> > The definition and content is just one object in the list. but that
> > should be a mere implementation detail that shouldn't affect the spec
> > wrt. hook scripts.
> 
> Good, that does make things easier (and means you don't need to dump the
> data out to get the data parts in the list to check if they're already
> in the new database, etc).

Darn, I just checked this again, and indeed the TABLE DATA is a
separate object in a dump. When I quickly checked this during our IRC
discussion, I looked at the listing when using --schema-only, where
it's quite natural not to have table data.

So I indeed have the problem you anticipated: I can only filter out the
table data for tables which already exist in the target cluster if I
either

 * run pg_dump with table data twice (the first one to determine the
   content, the second one for the actual dumping to the target
   cluster)

or

 * save the pg_dump output into a potentially huge temporary file.

Both methods are painful and utterly inefficient. Or do you have any
other idea?

My prefered solution would be an --ignore-list option of pg_restore
(or even better pg_dump) with some textual arguments (not IDs); but I
guess that requires some major code changes. 

Peter, do you happen to know if such a feature was already requested
by other people? Is the idea totally crackful, or if not, how much
effort would it be to implement it in pg_dump or pg_restore?

Thanks,

Martin

-- 
Martin Pitt        http://www.piware.de
Ubuntu Developer   http://www.ubuntu.com
Debian Developer   http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

Attachment: signature.asc
Description: Digital signature

Reply via email to