Deleting large object from table pg_largeobject - Mailing list pgsql-sql

From David
Subject Deleting large object from table pg_largeobject
Date
Msg-id 1047502777.1661.553.camel@localhost.localdomain
Whole thread Raw
Responses Re: Deleting large object from table pg_largeobject
List pgsql-sql
Hello,

I'm trying to delete a large object form the pg_largeobject table but I
get a  permission denied error (in both psql and with the java JDBC ).

Here is my sql stament in order:

fletcher=> SELECT * from md_blob ;
blob_id |  text  | file_name | mime_type  
---------+--------+-----------+------------      4 | 292470 | 2.jpg     | image/jpeg      21 | 292572 | 2.jpg     |
image/jpeg     22 | 292578 | 2.jpg     | image/jpeg 
 
(3 rows)

== If I try to delete it directly
fletcher=> delete from pg_largeobject where loid = (     select text from md_blob         where blob_id = 4 );

ERROR:  pg_largeobject: permission denied

fletcher=> delete from pg_largeobject where loid =
292470;                                        
ERROR:  pg_largeobject: permission denied

== If I try to delete all reference to it before, and then delete it
fletcher=> DELETE FROM md_blob WHERE blob_id='4';
DELETE 1

fletcher=> delete from pg_largeobject where loid = 292470;
ERROR:  pg_largeobject: permission denied
fletcher=> 

Anybody know what I am doing wrong? 

My ultimate goal is to delete the largeobject when I delete the row in
md_blob;

here is my system:
RedHat Linux 7.3
PostgreSQL 7.3.2 
JDBC driver from postgresql (v 7.3 with the property ?compatible=7.1 )
Java 1.3

thanks

david



pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: DELETE FROM A BLACK LIST
Next
From: mila boldareva
Date:
Subject: Re: LEFT JOIN and missing values