From: | Philip Warner <pjw(at)rhyme(dot)com(dot)au> |
---|---|
To: | "PostgreSQL Hackers" <pgsql-hackers(at)hub(dot)org> |
Cc: | Denis Perchine <dyp(at)perchine(dot)com> |
Subject: | pg_dump, BLOBs and single-table dumps - RFC |
Date: | 2000-10-01 14:41:05 |
Message-ID: | 3.0.5.32.20001002004105.02d44710@mail.rhyme.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
It recently came to my attention that, when dumping a single table and
using the --blobs option, pg_dump will dump all BLOBs (not just those
referenced by the table). Similarly, restoring a single table from a backup
will restore all the BLOBs.
This is (at least) non-intuitive.
Unfortunately, the task of restoring a single table with BLOBs is actually
somewhat complex: the OIDs will change, and the table needs to be updated
(which is fine), but it is definitely not clear how to handle other tables
in the database (since the current implementation allows multiple
references to one blob, which is very non-standard). The simple solution of
only updating the OID fields in the restored table seems as unintuitive as
the current situation, and also likely to produce unexpected results.
Also, scanning through the backup file for BLOBs used in the table to be
restored will be slow, to say the least. It can be done in one pass by
building an indexed temporary table with all OID fields from the target
table, but it is definitely getting messy. Especially since Jan was talking
about a decent BLOB implementation RSN.
My inclination at this stage is to disallow --blobs when dumping or
restoring a single table, but I would be interested in hearing from anybody
with a better solution.
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-10-01 15:19:37 | Re: memory management suggestion |
Previous Message | Jarmo Paavilainen | 2000-10-01 12:07:28 | What do I need to be able to compile the source in Win32 |