On Sun, 5 Dec 1999, Peter Eisentraut wrote:
> On 1999-12-01, Alf Lewerken mentioned:
>
> > How can I backup large objects of my database.
> >
> > I use pg_dump <databasename>
> >
> > This dumps the databasetables and indices properly but how do I
> > dump large objects?
> >
> > Because I use the oid´s of the large objects as a reference in the tuples in
> > some tables, the oid´s of the large object is important when dumping/restoring.
>
>
> There is no such facility right now.
>
> I added some large object handling commands into psql for 7.0, such as
> \lo_export, but those only work on a single object. I have no plans to
> implement any sort of loop, but perhaps you could write a shell script
> wrapper. Of course, that's not going to help you right now.
>
> The purpose of pg_dump is to create a text file that can be read back by
> psql, so interspersing the actual large object data in there won't be too
> much fun. All the LO handling functions can only read or write a file on
> the file sytem anyway, there is no COPY equivalent. pg_dump would need to
> export the objects to files that would need to be kept with the actual
> dump. That's actually feasible, I believe.
>
> As for an immediate solution, chances are you'd need to write something in
> C that does this.
>
On
ftp://ftp2.zf.jcu.cz/users/zakkr/pg/pg_dumplo-0.0.3.tar.gz
is available the large object dumper. I write this for my PgSQL project,
but it is good usable for all PG databases. It allow dump LO to files
and (vice versa) import this files to DB.
IMHO PostgreSQL needs any program for LO dumping and very interesting is
that it not exist in the standard distribution.
I can continue with development of this program if will interest.
Karel
----------------------------------------------------------------------
Karel Zak <[EMAIL PROTECTED]> http://home.zf.jcu.cz/~zakkr/
Docs: http://docs.linux.cz (big docs archive)
Kim Project: http://home.zf.jcu.cz/~zakkr/kim/ (process manager)
FTP: ftp://ftp2.zf.jcu.cz/users/zakkr/ (C/ncurses/PgSQL)
-----------------------------------------------------------------------
************