Thread: How can i delete large objects from DB?

How can i delete large objects from DB?

From
"Sergei M. Suntsov"
Date:
   Hi!
Man page on large objects describes how to create one, from file wit
lo_import, etc. But if i want delete row from the table which references
large object should I delete large object also? How can it be done ?
    Thanx in advance,
Sergei


Re: [GENERAL] How can i delete large objects from DB?

From
Dustin Sallings
Date:
> Man page on large objects describes how to create one, from file wit
> lo_import, etc. But if i want delete row from the table which references
> large object should I delete large object also? How can it be done ?

    Well, BLOBs aren't actually stored *in* tables, but you could do a
trigger mechanism that says ``if someone deletes something from this table, do
this'' ...this being, ``lo_unlink(that blob)''

--
SA, software.net         My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________


Re: [GENERAL] How can i delete large objects from DB?

From
Peter T Mount
Date:
On Mon, 3 Aug 1998, Dustin Sallings wrote:

> > Man page on large objects describes how to create one, from file wit
> > lo_import, etc. But if i want delete row from the table which references
> > large object should I delete large object also? How can it be done ?
>
>     Well, BLOBs aren't actually stored *in* tables, but you could do a
> trigger mechanism that says ``if someone deletes something from this table, do
> this'' ...this being, ``lo_unlink(that blob)''

An example of such a trigger is in the current development source (in
contrib/lo).

I'm currently working on a fix for orphaning (which is when a row
containing a reference to a blob is deleted, but the blob remains). I have
a possible solution, but currently cannot test it as postgresql is
currently broken on my machine.

--
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres