Re: Deleting Objects...

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Rolando Lora <rlddm(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Deleting Objects...
Date: 2001-03-26 03:43:16
Message-ID: Pine.BSF.4.21.0103251942050.57501-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, 25 Mar 2001, Rolando Lora wrote:

> Hi there...
>
> I'm not sure if this is a "bug" or not but I couldn't
> find how to deal with it.
>
> For instance if we create a table using "Object ID"
> for storing large objects:
>
> > create table picture(id serial, pic_oid oid);
>
> and then we add some data:
>
> > insert into picture
> (pic_oid) values (lo_import('/tmp/image.jpg'));
>
> We'll insert into the table an "Object Id" pointing to
> an external file "xin...OID".
>
> But when we execute:
>
> > delete from picture;
>
> The data contained in the table gets deleted but the
> real object "xin...OID" remains untouched when (I
> Think) it should be deleted too. Is this a bug?
>
> I'm developing an application where I need to upload a
> lot of pictures but when I delete some of them I don't
> want files floating around that used to be pictures.
>
> Is there anyway I can deal with it?

Generally speaking I think right now you need to put
a trigger on the table to remove the large objects when
the row is deleted.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Rainer Mager 2001-03-26 04:46:43 Dead locks
Previous Message Rainer Mager 2001-03-26 00:30:34 Problems with Multibyte in 7.1 beta?