Thread: pg_dump & blobs - editable dump?

pg_dump & blobs - editable dump?

From
Philip Warner
Date:
I have been speaking to Pavel about pg_dump support of blobs, and he thinks
it is important to allow for some kind of human-readable version of the
dump to be created.

My guess is that this will involve a plain text schema dump, followed by
all BLOBs in separate files, and a script to load them. To implement this
I'll obviosly need to be passed a directory/file location for the script
since I can't pipe seperate files to stdout.

I'd be interested in knowing what features people think are important in
this kind of format; what do you need to do with the blob files, what do
peple want to edit, etc etc.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 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   |/

Re: [HACKERS] pg_dump & blobs - editable dump?

From
Lamar Owen
Date:
Philip Warner wrote:
> My guess is that this will involve a plain text schema dump, followed by
> all BLOBs in separate files, and a script to load them. To implement this
> I'll obviosly need to be passed a directory/file location for the script
> since I can't pipe seperate files to stdout.

uuencode the blobs, perhaps, using a shar-like format?

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: [HACKERS] pg_dump & blobs - editable dump?

From
Philip Warner
Date:
At 10:13 12/07/00 -0400, Lamar Owen wrote:
>Philip Warner wrote:
>> My guess is that this will involve a plain text schema dump, followed by
>> all BLOBs in separate files, and a script to load them. To implement this
>> I'll obviosly need to be passed a directory/file location for the script
>> since I can't pipe seperate files to stdout.
>
>uuencode the blobs, perhaps, using a shar-like format?

For the human readable version, the request was to make it editable and
sendable to psql. As a result the BLOBs need to be in their binary format
OR psql needs to support BLOB import from stdin. As a first pass I was
hoping for the simple 'dump them into files' solution.

What I am confused by is what people actually want to do with a load of
BLOBs sitting in a directory; if there are specific needs, then I'd also
like to cater for them in the custom file formats.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 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   |/

Re: [HACKERS] pg_dump & blobs - editable dump?

From
Lamar Owen
Date:
Philip Warner wrote:
> At 10:13 12/07/00 -0400, Lamar Owen wrote:
> >Philip Warner wrote:
> >> I'll obviosly need to be passed a directory/file location for the script
> >> since I can't pipe seperate files to stdout.
> >
> >uuencode the blobs, perhaps, using a shar-like format?

> For the human readable version, the request was to make it editable and
> sendable to psql. As a result the BLOBs need to be in their binary format
> OR psql needs to support BLOB import from stdin. As a first pass I was
> hoping for the simple 'dump them into files' solution.

If in a shell archive format, shouldn't it be easy enough for pg_restore
to be made to do the stdin-to-blob thing (through whatever mechanisms
you're already using to get the blob back in in the first place,
combined with some steering/deshar-ing/uudecoding logic)?  The backup
could even be made 'self-extracting' as shars usually are... :-) Of
course, you then have to be on the watch for the usual shar trojans...

If we simply know that the backup cannot be sent to psql, but a
deshar-ed version can have the schema sent to psql, would that
ameliorate most concerns?

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Re: [HACKERS] pg_dump & blobs - editable dump?

From
Philip Warner
Date:
At 10:38 12/07/00 -0400, Lamar Owen wrote:
>
>If we simply know that the backup cannot be sent to psql, but a
>deshar-ed version can have the schema sent to psql, would that
>ameliorate most concerns?
>

In the current version

    pg_restore --schema

will send the schema to stdout

Is that sufficient? Or are you strictly interested in the text output side
of things?




----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.C.N. 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   |/

Re: [HACKERS] pg_dump & blobs - editable dump?

From
Lamar Owen
Date:
Philip Warner wrote:
> will send the schema to stdout

> Is that sufficient? Or are you strictly interested in the text output side
> of things?

Strictly interested in the text output side of things, for various
not-necessarily-good reasons (:-)).

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11