A Couple of Questions on Blobs

Started by Scott Holmesalmost 25 years ago2 messagesgeneral
Jump to latest
#1Scott Holmes
sholmes@pacificnet.net

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Scott Holmes (#1)
Re: A Couple of Questions on Blobs

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