pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Deleting a list of external xinv/xinx files using JDBC
2+ messages / 2 participants
[nested] [flat]

* Deleting a list of external xinv/xinx files using JDBC
@ 2001-01-16 02:51 xriley@encryptix.com
  2001-01-16 09:12 ` Re: Deleting a list of external xinv/xinx files using JDBC Peter T Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 2+ messages in thread

From: xriley@encryptix.com @ 2001-01-16 02:51 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: xriley@encryptix.com

I'm using the JDBC setBytes to insert a list of large object blobs.  
The side-effect of this is two external files (xinvOID and xinxOID) 
for every blob inserted.
 
If I use a JDBC delete sql statement to delete the records
containing the blobs,  the external xin* files are not deleted.
 
Is this by design? If so, is there a work around for deleting
a LIST of records AND the associated external blob file?
 
 
Foe example:
    CREATE TABLE "some_blobs" (
        "blob_id" int4 PRIMARY KEY,
        "the_blob" oid NOT NULL
     );
 
    JDBC insert statement for adding blob records:
        insert into some_blobs (blob_id, the_blob) values (?,?)
 
    JDBC delete statement for removing all blob records:
        delete from some_blobs
 
Thanks
Xavier

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Deleting a list of external xinv/xinx files using JDBC
  2001-01-16 02:51 Deleting a list of external xinv/xinx files using JDBC xriley@encryptix.com
@ 2001-01-16 09:12 ` Peter T Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter T Mount @ 2001-01-16 09:12 UTC (permalink / raw)
  To: xriley@encryptix.com; +Cc: pgsql-interfaces; xriley@encryptix.com

Quoting xriley@encryptix.com:

> I'm using the JDBC setBytes to insert a list of large object blobs.  
> The side-effect of this is two external files (xinvOID and xinxOID) 
> for every blob inserted.
>  
> If I use a JDBC delete sql statement to delete the records
> containing the blobs,  the external xin* files are not deleted.
>  
> Is this by design? If so, is there a work around for deleting
> a LIST of records AND the associated external blob file?

Yes this is by design (in the backend) as there is no real link between your 
table and the blob. If you look under /contrib you will find ways of fixing 
this using triggers that watch your table and when a row containing a blob is 
deleted or the blob amended then the old blob is deleted in the background.

Peter

-- 
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-01-16 09:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-16 02:51 Deleting a list of external xinv/xinx files using JDBC xriley@encryptix.com
2001-01-16 09:12 ` Peter T Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox