Thread: A Couple of Questions on Blobs

A Couple of Questions on Blobs

From
Scott Holmes
Date:
First, I believe I probably have some orphan blobs in one of my databases.  I
have updated some records, replacing one image oid with another before I knew
about lo_unlink.  Is there a method for finding such stranded objects?

My second question concerns updating existing blobs in a database.  I've been
asked to create some functions for inserting word processor documents in the
database, then allowing users to fetch them and edit them.  Looking at the lo_
functions provided, it seems to me I will need to lo_export(the_file); allow
the user to do what ever they want with it; lo_unlink(the_file); then update
table set doc_oid = lo_import(the_file)

Is this the correct methodology or am I missing something significant?

Thanks, Scott




Re: A Couple of Questions on Blobs

From
Tom Lane
Date:
Scott Holmes  <sholmes@pacificnet.net> writes:
> First, I believe I probably have some orphan blobs in one of my
> databases.  I have updated some records, replacing one image oid with
> another before I knew about lo_unlink.  Is there a method for finding
> such stranded objects?

I think contrib/vacuumlo will help.

            regards, tom lane