Re: [GENERAL] Backup of large object - Mailing list pgsql-general

From Peter T Mount
Subject Re: [GENERAL] Backup of large object
Date
Msg-id Pine.LNX.4.04.9812281641540.2134-100000@maidast.retep.org.uk
Whole thread Raw
In response to Backup of large object  (darold <darold@neptune.fr>)
List pgsql-general
On Thu, 24 Dec 1998, darold wrote:

> Hi,
>
> Thank for all answer of my question about null string. I have posted
> a message concerning backup of large object such image but I have
> lost my mail box so I don't know if there was some reply.
>
> So my question was :
>
> Is there any way to make back up to large object ? For saving all my
> database
> I use "pg_dump -D -f mysavefile.sql mydatabase". So I have read the man
> page
> of pg_dump and it says that there's no way to make a backup for large
> object
> with it.
>
> Should I have to develop a script for that or is there a simply way ?
> I use postgres 6.3.2

I think that backing up a large object has to be application specific,
because if you have to restore an object, you cannot guarantee that an
object will get the same OID.

The easiest way (which I have done before) is write a script for each
database that first runs pg_dump, then saves each large object in the
database, with it's oid.

There is then a restore script that re-loads the database, then inserts
the large objects. Once done, it then traverses the tables that refer to
them, replacing the old oid with the newly created one.

My backup and restore scripts call some Java code to handle the large
objects, as it's easy to save each large object directly into a compressed
Zip file, with it's OID as the filename.

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf


pgsql-general by date:

Previous
From: Marc Eggenberger
Date:
Subject: Problem with \copy
Next
From: Pascal X
Date:
Subject: [GENERAL] Unsupported frontend protocol error?