Re: [GENERAL] Backup of large object

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: darold <darold(at)neptune(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Backup of large object
Date: 1998-12-28 16:53:54
Message-ID: Pine.LNX.4.04.9812281641540.2134-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)retep(dot)org(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pascal X 1998-12-28 18:45:15 [GENERAL] Unsupported frontend protocol error?
Previous Message Marc Eggenberger 1998-12-28 14:28:08 Problem with \copy