Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] are BLOBs deleted that are not referenced?

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: David Wetzel <dave(at)turbocat(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-ports(at)postgresql(dot)org
Subject: Re: [HACKERS] are BLOBs deleted that are not referenced?
Date: 1998-07-05 10:06:50
Message-ID: Pine.LNX.3.96.980705110256.3600D-100000@maidast.retep.org.uk (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, 3 Jul 1998, David Wetzel wrote:

> Hi,
> 
> are BLOBs deleted that are not referenced any more?

No, they remain in the database, and become 'orphaned'. We are looking at
ways of removing this problem, which occurs mainly with JDBC & ODBC based
clients.

There is one method in src/contrib/lo which goes some way in solving this,
but there was also discussion about using vacuum to remove the orphaned
blobs.

> Imagine, I have a table with a column
> 
>   | text   | oid  |     4 |
> 
> when this row is deleted, will postgres throw the BLOB away?

The lo type (src/contrib/lo) handles row deletion (as well as updates) by
defining a trigger which deletes the associated blob as required.

However, DELETE TABLE doesn't fire a trigger, so if the table's contents
don't get deleted first, then the blobs are again orphaned.

-- 
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk


In response to

pgsql-hackers by date

Next:From: Peter T MountDate: 1998-07-05 10:38:25
Subject: JDBC Driver Development Hitch
Previous:From: Bruce MomjianDate: 1998-07-05 00:05:25
Subject: Re: [HACKERS] Revised proposal for libpq and FE/BE protocol changes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group