Dangling large objects

Started by Adam Haberlachover 25 years ago3 messagesgeneral
Jump to latest
#1Adam Haberlach
adam@newsnipple.com

I'm in a bit of a bind here. I wrote some code in our abstraction
layer to automatically unlink large objects when the row referencing
them is deleted (I know that they are only referenced once). However,
I neglected to include them in a transaction, so I'm pretty sure that
those unlinks never happened.

Is there any simple way for me to get a list of all large objects
in a database, so I can see if there are actually rows referring to them
and delete the ones that were not unlinked earlier?

--
Adam Haberlach |A cat spends her life conflicted between a
adam@newsnipple.com |deep, passionate, and profound desire for
http://www.newsnipple.com |fish and an equally deep, passionate, and
'88 EX500 |profound desire to avoid getting wet.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Adam Haberlach (#1)
Re: Dangling large objects

Adam Haberlach <adam@newsnipple.com> writes:

Is there any simple way for me to get a list of all large objects
in a database, so I can see if there are actually rows referring to them
and delete the ones that were not unlinked earlier?

Look at the vacuum_lo contrib module.

BTW, I believe lo_unlink doesn't need to be in a transaction block,
only lo_open/read/write/close do.

regards, tom lane

#3Brett W. McCoy
bmccoy@chapelperilous.net
In reply to: Adam Haberlach (#1)
Re: Dangling large objects

Dangling large objects? I thought this was a family list. :-)

-- Brett

PS. Sorry, couldn't resist...

http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
Unnamed Law:
If it happens, it must be possible.